I'm currently working on a HA system and I'm a little stuck deciding how to handle the logic.
The simplest option is to hard code everything. The obvious down side is that a change to the logic requires that the program be recompiled. I don't really want to do that.
At the other end of the spectrum, everything could be a script. When an input comes in, the controller looks for a matching script which can then trigger outputs, timers, etc. This approach is much more flexible but involves a lot more work and requires a more powerful controller, more storage, etc.
At the moment I'm tending towards the middle ground. Certain common tasks have function specific logic built in and just load configuration data (e.g. the alarm system just loads a list of sensors and lights to associate with each zone) but a basic scripting capability is available for more advanced functions.
Has anyone here made their own HA system? How did you encode the logic? What are the pros/cons? What would you change if you were doing it again?
The simplest option is to hard code everything. The obvious down side is that a change to the logic requires that the program be recompiled. I don't really want to do that.
At the other end of the spectrum, everything could be a script. When an input comes in, the controller looks for a matching script which can then trigger outputs, timers, etc. This approach is much more flexible but involves a lot more work and requires a more powerful controller, more storage, etc.
At the moment I'm tending towards the middle ground. Certain common tasks have function specific logic built in and just load configuration data (e.g. the alarm system just loads a list of sensors and lights to associate with each zone) but a basic scripting capability is available for more advanced functions.
Has anyone here made their own HA system? How did you encode the logic? What are the pros/cons? What would you change if you were doing it again?