Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support commandToggle and command*WithOnOff triggering polling of Hue bulbs #6192

Merged
merged 6 commits into from
Feb 9, 2021

Conversation

crowbarz
Copy link
Contributor

@crowbarz crowbarz commented Feb 9, 2021

Added Zigbee commands generated by Tradfri 5-button remote (model TRADFRI remote control) to the list that trigger polling on Hue bulbs. Thus this PR allows the use of Tradfri 5-button remotes to control Hue bulbs just like the Hue dimmers, without having to poll them via external automation.

  • The centre button sends commandToggle when pushed, and commandMoveToLevelWithOnOff when held.
  • The brightness up button turns on the bulb if it was off, via commandStepWithOnOff (pushed) and commandMoveWithOnOff (held), so need to poll genOnOff cluster as well. (The brightness down button does not turn off the bulb.)
  • Other than brightness up with bulb off, brightness up/down pushes already triggered polling.

@Koenkk
Copy link
Owner

Koenkk commented Feb 9, 2021

Thanks!

@Koenkk Koenkk merged commit 2515d5f into Koenkk:dev Feb 9, 2021
@MattWestb
Copy link

The toggle button is sending one IKEA special command then being long pressed that is resetting the IKEA light to its default scenes so its being synced also the light levels is doing the same (being 100%).
Dont messing with the long press of the toggle for other things then you is making on mess of all.

@crowbarz
Copy link
Contributor Author

The Tradfri remote is sending commandMoveToLevelWithOnOff to its bound group on long press. This command also causes Hue lights to turn on at 100% brightness. On Tradfri lights, a long press does not trigger a scene change (the colour temperature remains as it was) nor does it reset configured scenes to default.

In any case, this code only triggers polling on Phillips Hue lights, and is not executed at all for Tradfri lights. Tradfri lights are expected to send reports when their state/brightness/colour temperature changes.

@MattWestb
Copy link

If its working OK with HUE its great.

If you is setting up scenes that is working with the IKEA "magic group" its 110% setting the light to first scene that is correct defined the light. And if you dont have that it can not changing scene then its no scene to changing 2.

Read the manual for the remote and look how its behaving then ts being setted up with scenes OK.

Its still braking the working scenes with IKEA light !!!
And you have not setting up scenes that is working OK with the remotes so you cant saying its not braking it then you have not testing it.

Do some sniffing of the traffic the remote is sending and you is knowing you is wrong.

One PM the IKEA remote is NOT sending scene commands to its bonded group its being sended to on default group that IKEA is used and is normal refereed as "magic group" that is 0xff09 / 65189.
zigpy/zha-device-handlers#561.

Sniffed and verified its working with Z2M if congratulating the scenes OK.
Some user have getting it working with the magic group in Z3M #1232 (comment)

@crowbarz
Copy link
Contributor Author

@MattWestb your comments are related to scenes on Tradfri bulbs, and this PR is completely unrelated to both scenes and Tradfri bulbs. commandMoveToLevelWithOnOff is a standard ZCL command (defined in the ZCL spec). The Tradfri remote just happens to send this command when toggle is held. It may send other special commands to Tradfri bulbs at the same time, but that is irrelevant to this PR and to the underlying poll functionality.

@MattWestb
Copy link

I dont care of wot you is doing with all bottoms but still the long press of the toggle is making other thinks that you is braking believe my or not.

Before you is saying something, pairing the remote and set up correct scenes that can being changed from thee remote. You can do that with Z2M or iKEA GW.
Sniffing the traffic and you can saying wot or not the remote is doing / sending.

And as one alternative you can also reading some thousands post that is being made also some with good stiffening attached.
All IKEA controlling devices is real ZLL / ZB3 light controlling devices and dont braking that with some hacks that is using commands for other things that is not intended to.

And you dont have any using of the long press toggle for IKEA or other devices lights.

One more time dont use the long press toggle !!!!

@MattWestb
Copy link

One more thing ZCL 6 is outdated and if you is using it then you must consider https://zigbeealliance.org/wp-content/uploads/2019/11/docs-15-0014-05-0plo-Lighting-OccupancyDevice-Specification-V1.0.pdf that is one appendix to ZCL for zigbee 3 devices.

@crowbarz
Copy link
Contributor Author

Your concerns and boldfaced comments are duly noted.

Feel free not to use long press toggle on your own Zigbee networks(s) as you clearly feel so passionate about this. I, and others with Tradfri remotes that control Hue bulbs, will continue happily using the Tradfri remote as a cheap remote that happens to generate commandToggle and commandMoveToLevelWithOnOff commands, possibly amongst other commands it sends, on our far simpler and probably totally flawed networks that work well enough for our needs.

@crowbarz crowbarz changed the title Support Tradfri Remote buttons triggering polling Support commandToggle and command*WithOnOff triggering polling of Hue bulbs Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants