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:

'http://localhost:8080/controller/rest/control/{control_id},{command_param}'
'http://localhost:8080/controller/rest/status/{sensor_id},{sensor_id},...'

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?

I find this too difficult to implement through a rule.

In fact what you want to do is quite simple through rules. Perhaps in case that it is too difficult for you then you can consider hiring somebody who can do it for you?

On the other hand, the way you want to implement it is much more difficult and fragile - mind that sensor_id's are dynamic and can change with controller.xml update.

Posted by aktur at Mar 16, 2014 09:59
Document generated by Confluence on Jun 05, 2016 09:39