Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
201 stars 67 forks source link

Hue Group no longer outputs msg.payload.allOn #323

Closed MrTeal closed 2 years ago

MrTeal commented 2 years ago

Describe the bug So I was a tad behind on my updates inside nodeRED and only just updated to the 4.1.0, but before the Hue Groups node used to output more than only "on/off". Before it had states like: someOn, allOn. I used those states in my nodeRED flows to determine if it could or could not do something. Because if they were allOn it meant a scene was active, so it shouldn't overwrite, but if it had someOn it meant it could be overwritten by the automation.

It would be really nice to get those states back if possible.

Flow to Reproduce

[{"id":"604bc830794e02ad","type":"server-state-changed","z":"6f5e5634.103ad8","name":"Licht genoeg?","server":"da6952e7.c702c8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.lightlevel_wk_motion","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"30","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"output_only_on_state_change":true,"for":"5","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":70,"y":860,"wires":[["f5afe07fa194d068"],[]]},{"id":"f5afe07fa194d068","type":"hue-group","z":"6f5e5634.103ad8","name":"Woonkamer","bridge":"be9c5c13.160a58","groupid":"27d9c784-0c4f-4a58-b9c3-486893252f2e","skipevents":false,"initevents":false,"x":230,"y":820,"wires":[["742b786106bb888a"]]},{"id":"742b786106bb888a","type":"switch","z":"6f5e5634.103ad8","name":"AllOn","property":"payload.allOn","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":860,"wires":[["e7f37365c33dc5c1"],[]]},{"id":"e7f37365c33dc5c1","type":"api-current-state","z":"6f5e5634.103ad8","name":"WK >=30 lx","server":"da6952e7.c702c8","version":3,"outputs":2,"halt_if":"30","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.lightlevel_wk_motion","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":860,"wires":[["8115c995b52ba106"],[]]},{"id":"da6952e7.c702c8","type":"server","name":"HomePi Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"be9c5c13.160a58","type":"hue-bridge","name":"Philips hue","bridge":"192.168.0.60","key":"b7Dv-F35N0ZDNqP7H886Sg9vlhc8qXDhIIpfq9rg","worker":"10","disableupdates":false}]

Expected behavior msg.payload has the property allOn again (that's the one I mostly use) msg.paylod.allOn: true/false

Please complete the following information:

Hope this is enough information. if not feel free to contact me and I'll happily provide more info if I can.

uli-rpi commented 2 years ago

That's not a bug, the documentation says, "... the group only post status messages when either the last light WILL be turned off, or the first light WILL be turned on (if everyone was off before)..."

but, i would also like to have the status "any on / all on" back, maybe with the restriction that only device types = light are taken into the result.

andesse commented 2 years ago

@MrTeal @uli-rpi

Like Uli says, this is normal behavior. The API V2 from HUE actually don't use rooms / zones. It is used to make it a more convenient user experience in the app.

Actually all rooms/zones are just grouped_lights in the api with an identifier that represents the roon/zone. As the firmware moves more forward the API V2 replaces more and more functions from the API V1.

The all.on is depreciated and is replaced by just on in the new API with an identifier for the group.

MrTeal commented 2 years ago

Thanks for the response! I chose bug when creating this because there wasn't really another applicable option (it didn't think it was an improvement that stuff no longer got outputted). But I now know this option will not be returning. Shall I close this?

andesse commented 2 years ago

@MrTeal i think it's fine to do. The issue is investigated

MrTeal commented 2 years ago

Will do, thanks!