Idea: use python to directly generate rules files

If you don’t like python2 you could use HABApp to automatically do these things which runs from python 3.6 on.