Forums : Using Scripts instead of Rules to implement a simple Thermostat
This page last changed on Mar 15, 2014 by alexroche.
I find rules too complicated...
Is there any way to access OR commands and OR sensors from a script ?
I want to run a script in the background to implement a simple thermostat that can be Enabled or Disabled. If it is enabled it will periodically check if sensor current_temperature is <= desired_temperature and depending on it it will issue the command heater_on or heater_off. The next step will be to add more capabilities to automatically enable or disable the thermostat at specific times of the day. I find this too difficult to implement through a rule.
I guess it´s possble through HTTP using this API:
But then I don´t find an easy way to determine control_ids and sensor_ids. I assume I need to look for them in controller.xml, but then, will these IDs change when I am still adding and deleting commands and sensors from designer?
Is there a simpler way to access commands and sensors from a python script?
|Document generated by Confluence on Jun 05, 2016 09:39|