Feature: Zigbee Green Power support
Zigbee Green Power support has now been added. This enables support for e.g. the Philips Hue Tap and Friends of Hue switches.
I've created this issue in order to discuss this functionallity.
- Requires latest dev branch
- Documentation (important)
So If I'm reading the docs right, this won't work without a Philips Hue device, am I right?
So even If I bought a Hue Tap only (without any bridges, other Hue devices, etc.) I wouldn't be able to use it.
@electrofloat correct (and it needs to be in range)
@electrofloat correct (and it needs to be in range)
That's a shame.. I'd have liked to use it in itself (without any other devices). But great improvement anyways. Maybe in the future some miracle happens and makes this doable :)
@electrofloat maybe in the future an additional CC2652R router can also be used for this. But for sure a "special device" is needed to make it work.
Have you tried the green power firmware for xbee? I did see yesterday when I was trying to get xbee working with z2m they had a dedicated ZigBee green power firmware. Anything you want me to try?
@Koenkk I've just tested this and I managed to get my two Hue Tap switches to pair. They are now in the database and I assigned a friendly name, but I cannot see anything in the debug log after the pairing when I push the buttons. There are also no mqtt messages on zigbee2mqtt/friendlyname.
Are there any additional steps needed to get this to work or what am I doing wrong?
By the way, I managed to get the devices paired on channel 11 by long clicking on the big button with the one dot that surrounds the smaller buttons. (The documentation states that only channel 15, 20 and 25 can be used)
@TheNetStriker thanks for testing this, any chance you could sniff the traffic when joining the device and pressing buttons afterwards? https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html
@Koenkk I already uploaded a packet capture in the first thread about the Hue Tap. Here is the link to the pcap file: https://www.dropbox.com/s/pk1jt5h5yvtkb36/HueTap.pcapng?dl=0
Or do you need a fresh packet capture for this?
I also found something about the Hue Tap in the log:
zigbee2mqtt:error 2020-04-11 13:12:59: Failed to execute LQI for 'huetap_1'
zigbee-herdsman:adapter:zStack:znp:SREQ --> ZDO - mgmtLqiReq - {"dstaddr":28743,"startindex":0} +10s
zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,3,37,49,71,112,0,32] +10s
zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,1,101,49,0,85] +10s
zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,1,101,49,0,85] +0ms
zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 1 - 3 - 5 - 49 - [0] - 85 +0ms
zigbee-herdsman:adapter:zStack:znp:SRSP <-- ZDO - mgmtLqiReq - {"status":0} +10s
zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +1ms
And in the state.json this is the only property that the device has: "linkquality": 0
Green power devices don't respond to these LQI requests, so I've excluded them from the network scan (fixed in latest dev branch)
Regarding the sniff, it doesn't contain useful information. I need a sniff in were they are also successfully paired with zigbee2mqtt.
Congratulations on getting this working! Should the docs also specify that a Zigbee 3.0 firmware is needed for this to work, or did you manage to get it to work with Zigbee 1.2 as well?
@ndfred it also works with 1.2
Just tried it with zStack12 on channel 20, worked wonderfully! Held the button for 10 seconds, paired immediately when I let go, all buttons work no problem. I went around the house to see if the taps would register everywhere (I wondered if it would use the mesh network or if it would only communicate through its gateway bulb) and it worked flawlessly everywhere. Super happy I could pair all my remotes now!
A few nits that might be worth calling out in the documentation:
- binding doesn't work (I expected that, but always good to be explicit)
- the vendor might need some polish, I would have expected it to be Philips (not a big deal relly)
Specifically this is the configuration entry for the device (mine is a Philips Hue Tap switch which I bought in France ages ago):
{
"ieeeAddr": "0x0000000000408e0f",
"type": "GreenPower",
"networkAddress": 36367,
"model": "GreenPower_On_Off_Switch",
"vendor": "GreenPower",
"description": "On/off switch",
"friendly_name": "bedroom_fred_bedside_remote",
"manufacturerID": null,
"modelID": "GreenPower_2",
"lastSeen": 1586699144251
}
TBH this is a super niche type of switch (expensive and not very nice to tap) so I would understand if you don't want to bother with that, but if you do I am more than happy to redo all the pairing with whatever debug logs you need to display the proper hardware profile.
And thanks again for getting this to work!
@ndfred thanks, added this to the docs.
We cannot distinguish between e.g. a Hue Tap and a Friends of Hue Niko switch, Green Power device don't share such specific information.
@Koenkk I've just uploaded a new packet capture to my Dropbox: https://www.dropbox.com/s/andvjbcpr78p8jk/HueTap.pcapng?dl=0
@TheNetStriker I need your network key in order to decrypt te sniff, please send them to me on telegram (@koenkk).
This is fantastic! This was the only thing keeping me from migrating away from my Hue bridge :)
I tried this with a Niko Friends of Hue switch and a couple of Philips Hue bulbs, with a CC2531 USB stick.
Some notes:
- Is it possible to clarify which actions are supported by which devices? Looking at https://github.com/Koenkk/zigbee-herdsman-converters/blob/21ebddc40f13df79eeb3bd47adbace614826f93b/converters/fromZigbee.js#L4503, a lot of actions are listed, but I find that for the switch I tested only 'recall_scene_x', 'press_x_of_2' and 'release_x_of_2' seem to be supported.
- For the switch I tested, these names are also misleading. Better would be: 'recall_scene_[0-3]' -> 'button_press_[0-3]' and 'recall_scene_[4-7]' -> 'button_release_[0-3]'
- I sometimes experience a (large) delay. At this point I am unsure whether the delay is caused by the fact that the CC2531 is underpowered, a zigbee2mqtt performance issue, or a performance issue in the automation code processing the mqtt messages (I use openhab on a raspberry pi). With the Hue Bridge, response was always instantaneously.
Sharing my experience with it, hoping it might be helpful to you, I have a Hue Tap and not a Niko one:
- the actions I've been able to capture are
toggle,recall_scene_0,recall_scene_1andrecall_scene_2respectively for the buttons with 1, 2, 3 and 4 dots - I haven't seen any delay, how long is "large" in your experience? A few things worth checking:
- if you tail the ZigBeeToMQTT logs while you are taping the buttons, are you seeing the delay? If not then maybe OpenHAB is introducing it.
- are you seeing a lot of traffic when tailing the ZigBeeToMQTT log? If so you might see contention on the network.
- did you change your ZigBee channel from the value you had on the Hue bridge? You might now see interference you didn't see before
- can you share the link quality of the bulbs around the switch, and have a look at your network map to if the routing makes sense? It might take a bit for your new network to adapt.
- are you running your CC2531 USB stick from a USB extension cord, and do you have a PCB antenna or an actual antenna? The shielding might be worse than the Hue Bridge.
- do you still have the Hue bridge running? That could cause ZigBee interference if they are on the same channel (though ZigBee is not that chatty).
- how large is your ZigBee network (number of devices)? CC2531 is performance issues are only apparent past a certain threshold
I have 17 devices including 6 remotes and one motion detector so really 10 devices that are always on the network, which is not a lot for the CC2531. My Hue Tap remote link quality is 10, which is less than other devices but I guess that is down to its low power budget.
Is it possible to clarify which actions are supported by which devices? Looking at
- Hard to do, the main problem is that we cannot identify which device it exactly is, unlike non green power devices, they don't share an exact model ID.
For the switch I tested, these names are also misleading. Better would be: 'recall_scene_[0-3]' -> 'button_press_[0-3]' and 'recall_scene_[4-7]' -> 'button_release_[0-3]'
Because of point 1, we cannot further specify the actions, it make work for e.g. the hue tap but not for another device, currently I made the action match against the green power specification.
@ndfred Thanks for the quick responses!
I haven't seen any delay, how long is "large" in your experience?
Multiple seconds - up to 5.
if you tail the ZigBeeToMQTT logs while you are taping the buttons, are you seeing the delay? If not then maybe OpenHAB is introducing it. are you seeing a lot of traffic when tailing the ZigBeeToMQTT log? If so you might see contention on the network.
I will do some more experiments in the next days.
did you change your ZigBee channel from the value you had on the Hue bridge? You might now see interference you didn't see before
Yes, my Hue bridge was running on a different channel (I had 2 zigbee networks running in parallel for the past year - one for the Hue bridge, one for zigbee2mqtt). It could be that the Hue Bridge channel was more robust, I will check that if none of the other suggestions help.
can you share the link quality of the bulbs around the switch, and have a look at your network map to if the routing makes sense? It might take a bit for your new network to adapt.
Good points, will check that later this week.
are you running your CC2531 USB stick from a USB extension cord, and do you have a PCB antenna or an actual antenna? The shielding might be worse than the Hue Bridge.
Yes, I run the USB stick from an USB extension cord. I do not use any PCB or antenna.
do you still have the Hue bridge running? That could cause ZigBee interference if they are on the same channel (though ZigBee is not that chatty).
No, I shut it down. As mentioned above, it was running fine in parallel with zigbee2mqtt for the past year.
how large is your ZigBee network (number of devices)? CC2531 is performance issues are only apparent past a certain threshold
I have 29 devices (and 3 groups). Note that I use the Niko switch to control groups of 3 bulbs using the 'groups' configuration, which works very well (they always go on/off in sync, albeit sometimes with that delay).
I will do more tests during the weekend. Thanks for the help!
@Koenkk
Because of point 1, we cannot further specify the actions, it make work for e.g. the hue tap but not for another device, currently I made the action match against the green power specification.
Ah, that helps! Might be a good idea to clarify that in the documentation.
I sometimes experience a (large) delay. At this point I am unsure whether the delay is caused by the fact that the CC2531 is underpowered, a zigbee2mqtt performance issue, or a performance issue in the automation code processing the mqtt messages (I use openhab on a raspberry pi). With the Hue Bridge, response was always instantaneously.
if you tail the ZigBeeToMQTT logs while you are taping the buttons, are you seeing the delay? If not then maybe OpenHAB is introducing it. are you seeing a lot of traffic when tailing the ZigBeeToMQTT log? If so you might see contention on the network.
I will do some more experiments in the next days.
Additional testing pointed indeed to Openhab and its MQTT broker. After optimizing those, zigbee2mqtt + Green Power support now works similar to the old Hue bridge :-)