there’s another thing I have been looking for since forever, trying to sync the Hue setup and App with HA. the settings for the accessories, more specifically the motion sensors scheduling rules.
It would really be of great added value, if we could template these in our HA automations. AS it stands now, we have to hard code these Day and night times (and the action) manually in the automations. Would be really really cool if we could use a template for that.
Trying to read the API, one can browse down to /rules, and for one a sensor find this:
http://192.168.1.212/api/api/rules/20
{"name":"MotionSensor 48.night-dark-on","owner":"redacted owner","created":"2019-01-20T12:58:29","lasttriggered":"none","timestriggered":0,"status":"enabled","recycle":true,"conditions":[{"address":"/config/localtime","operator":"in","value":"T22:00:00/T07:00:00"},{"address":"/sensors/48/state/presence","operator":"eq","value":"true"},{"address":"/sensors/49/state/dark","operator":"eq","value":"true"},{"address":"/sensors/49/state/dark","operator":"dx"},{"address":"/sensors/50/state/status","operator":"lt","value":"1"}],"actions":[{"address":"/groups/2/action","method":"PUT","body":{"scene":"fHEB6SwiIIlSXMt"}},{"address":"/sensors/50/state","method":"PUT","body":{"status":1}}]}
I am especially interested in the value":"T22:00:00/T07:00:00 and would like to use these times.
of course my top question would be if you could have a look and see if these could be added to the properties of the motion sensors, and as a consequence have them available for templating of off the binary_sensors now created.
If not, please would you help me create a command line sensor like this which I use for several lights testing for reachability:
- platform: command_line
name: Driveway reachable
command: !secret driveway_command
value_template: >
{{value_json.state.reachable}}
driveway_command: curl -X GET http://192.168.1.212/api/ID/lights/13/
I can seem to get to the value with the times from http://192.168.1.212/api/API/rules/20
please let me invite @pnbruckner for this too, since you have helped me before in going down in these nested listed templates…