Hello,
I’ve been tinkering for a while now but can’t get to do what I want.
It seems basic yet I have the feeling I’m missing an info to get it working.
I’d like to trigger a service or another depending on the parameter of a bulb.
Meaning, in my case:
if brightness is 250, then turn it down (light on at brightness 5)
if brightness is 5, then turn it up (light on at brightness 250).
Seems easy yet the way I set it up, it doesn’t seem to read the value of brightness. I either get “Null” or “on” in the debug node.
I’ve tried putting the get state node in number vs string, tried different combination of payload (see below) but nothing works.
I’m gonna need to be able to read precisely the state of object quite often so I’d like to get a hold on this.
Any advice/tips would be highly appreciated.
[{"id":"8bc4e3bf.90d4b8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"19ecf8bb.35d07f","type":"api-current-state","z":"8bc4e3bf.90d4b8","name":"Check Chambre","server":"99271793.4a9158","version":1,"outputs":2,"halt_if":"250","halt_if_type":"num","halt_if_compare":"is","override_topic":true,"entity_id":"light.chambre","state_type":"str","state_location":"payload.event.new_state.attributes.brightness","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":370,"y":260,"wires":[["a1f5c388.689678"],["f3554220.f40c18"]]},{"id":"a1f5c388.689678","type":"debug","z":"8bc4e3bf.90d4b8","name":"Forte","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":230,"wires":[]},{"id":"f3554220.f40c18","type":"debug","z":"8bc4e3bf.90d4b8","name":"Douce","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":310,"wires":[]},{"id":"93ab8801.9acd88","type":"api-current-state","z":"8bc4e3bf.90d4b8","name":"Check Chambre","server":"99271793.4a9158","version":1,"outputs":2,"halt_if":"250","halt_if_type":"num","halt_if_compare":"is","override_topic":true,"entity_id":"light.chambre","state_type":"str","state_location":"payload.event.service_data.brightness","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":370,"y":440,"wires":[["af9d1298.1ce53"],["1c7f4f31.c7a1c9"]]},{"id":"af9d1298.1ce53","type":"debug","z":"8bc4e3bf.90d4b8","name":"Forte","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":410,"wires":[]},{"id":"1c7f4f31.c7a1c9","type":"debug","z":"8bc4e3bf.90d4b8","name":"Douce","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":490,"wires":[]},{"id":"99271793.4a9158","type":"server","z":"","name":"Olympe","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Thanks a lot.