My question is… is there a way I can have both sensors return the 'lightlevel" value as the “state” of the sensor as opposed to returning 'OK" as the state and the “lightlevel” as an attribute?
Should work provided the REST data is under 255 characters long. Alternatively, leave it as it is and set up template sensors whose state pulls the attribute from these sensors.
Please paste both the sensor you tried that didn’t work, and the response from that URL when accessed with a web browser.
You will have to use my format ['112'] as opposed to @koying’s .112 which will get confused with a list index [112] — unless you are genuinely after the 113rd and 115th elements.
My 1st ‘platform’ example was working. I was getting a ‘dupe key’ message when trying to add the 112 side. I believe that was because I was adding it with another sensor: label.
Your way works fine. I am thinking your way is making 2 individual trips to the Hue Hub, no? Is there any way to ‘set’ the polling frequency for these individual sensors? I keep seeing examples of folks setting a “scan_interval:”, but no where in the docs have I seen it as an option.
Another question I couldn’t figure out was what is the difference between setting these up as a ‘platform’ and not?
Setting up as a rest sensor platform (under a top-level rest) allows setting the scan_interval: see the docs. It also only makes one call to the resource.
The code you posted starting with rest: looks like it should work: what’s the problem?
don’t you use the HUE integration? because that does not all for you, and as explained in the other thread, pushes all state changes so no need to create those rest sensors at all
I do not believe the light or temperature are ‘pushed’ by the Hue device. I could be wrong, as I am new to this stuff, but in my testing of the motion / lightlevel / temperature, only the motion is pushed, and that is only with this new release of HA (and the latest Hue update of the last few weeks I assume).
Nothing to be proud of, I just tested it and looked at the error message
In all honesty, the message is not helpful until you reduce to `{{ value.json }}’