I'd like to share my intelligent multi-zone heating script which I use to control my on/off central heating system. It attempts to predict the time needed to pre-heat a zone so it reaches the desired temperature when a thermostat timer is triggered. It uses an outside temperature sensor to make this prediction even more accurate. It can open/close valves in zones that do not need any heating, although there's still some work to be done there (see todos at the top of the script).
The script uses a separate sqlite database to store temperature deltas used to predict the pre-heat duration. Unfortunately it's currently not possible to load dynamic lua support for sqlite, so access to this database is done through system calls, which get the job done but isn't as robust as I'd like it to be.
Tell me what you think. Any hints, tips or other useful contributions are most welcome

https://github.com/bobkersten/domoticz-lua.git
Cheers,
Bob.