Hello all.
One of my house-mates keeps accidentally turning the Hue lights off at the wall. So I want to monitor whether they’re reachable or not.
I’ve been looking at the REST platform to access the Hue’s CLIP API
So far, I have this working:
sensor:
- platform: rest
name: 'Random light name'
resource: http://192.168.1.~~~/api/~~~/lights/1
value_template: '{{ value_json.state.reachable }}'
I know the code below won’t work, but what it illustrates sort of what I’m aiming for:
sensor:
- platform: rest
name: '{{ value_json.state.name }}'
resource: http://192.168.1.~~~/api/~~~/lights/*
value_template: '{{ value_json.state.reachable }}'
This would allow me to grab the whole list of lights and their actual names without having to define them manually.
Any JSON wizards know if this is possible? Or to read in the larger JSON object into another sensor and then parse the attributes out of that?