I recently wrote about how to do a declarative model for automations, which I use throughout the house: http://peterhajas.com/blog/declarative_home_automation.html
I recently wrote about how to do a declarative model for automations, which I use throughout the house: http://peterhajas.com/blog/declarative_home_automation.html