Skip to content

IKEA STYRBAR and Minor changes #4627

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

Merged
merged 13 commits into from
Mar 27, 2021
Merged

IKEA STYRBAR and Minor changes #4627

merged 13 commits into from
Mar 27, 2021

Conversation

ebaauw
Copy link
Collaborator

@ebaauw ebaauw commented Mar 22, 2021

  • Add support for IKEA STYRBAR, see Device Request IKEA STYRBAR #4572.
    • Whitelist device in de_web_plugin.cpp;
    • Add commands to button_map.json;
    • Hack in checkSensorButtonEvent() to ignore additional commands on holding left or right button (see issue);
    • Streamline code for SHORTCUT and SYMFONISK, in line with STYRBAR:
      • Only bind OnOff client cluster to group;
      • Discard unicast from client cluster to prevent double button events;
      • Fix bugs in verifying bindings/reporting;
      • Remove unneeded code for binding SYMFONISK to coordinator, as it sends commands to coordinator already by default.
    • TODO: Check older IKEA end devices for double button events (haven't seen any reports, so don't expect any;
    • TODO: Check whether old wireless dimmer (with dial) sends commands to coordinator by default as well;
    • TODO: Check whether old IKEA end devices can do with one client binding as well.
  • Add support for Aqara Opple in controller mode, see No switch event x003 after long press - Aqara/Opple  #4589. No support for switching modes, though; you'll need to do this manually through the GUI (as describes in the issue)... every time deCONZ restarts;
    • Add commands to button_map.json;
    • Add support for Step Color Temperature command in checkSensorButtonEvent();
  • Add to general.xml the IKEA-specific scene commands as sent by the TRADFRI remote control on the left and right buttons, so they can be sent from the GUI. Still cannot get them to work, though...
  • Add new button mapping for TRADFRI wireless dimmer, under mode 1, see Wiki.
  • Disable check for "too fast event", as this interferes with the correct function of several IKEA and Hue devices.

ebaauw added 4 commits March 20, 2021 14:19
Add IKEA-specific scene commands as sent by the TRADFRI remote control on the left and right buttons.
@ebaauw ebaauw marked this pull request as draft March 22, 2021 23:09
@ebaauw ebaauw changed the title Minor changes IKEA STYRBAR and Minor changes Mar 22, 2021
@ebaauw ebaauw linked an issue Mar 22, 2021 that may be closed by this pull request
@manup manup marked this pull request as ready for review March 25, 2021 10:55
@manup
Copy link
Member

manup commented Mar 25, 2021

Ah damn I pressed "Ready for review" thinking I was starting review but now PR status changed.
So far PR looks fine to me.

@manup manup requested review from manup and SwoopX March 25, 2021 10:56
Copy link
Member

@manup manup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine so far

@ebaauw ebaauw marked this pull request as draft March 25, 2021 11:06
ebaauw added 4 commits March 25, 2021 21:59
Expose TRADFRI wireless dimmer as two buttons: Turn Right and Turn Left, cf. SYMFONISK.  See Wiki, https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/IKEA-controllers#ictc-g-1.
New map is for `mode` 1, old map for mode 4 will remain in effect, until you patch the database to mode 1.
- Disable check on "too fast event" - it causes weird effects for IKEA and Hue switches.
- Allow ModeScenes for TRADFRI wireless dimmer.
@ebaauw ebaauw requested a review from manup March 26, 2021 13:36
@ebaauw ebaauw marked this pull request as ready for review March 26, 2021 13:36
@ebaauw
Copy link
Collaborator Author

ebaauw commented Mar 26, 2021

I think this is good to go for now. Still sanity-checking the older IKEA controllers (see also new [Wiki](https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/IKEA-controllers page).

@manup, @SwoopX please note that I commented out the check for "too fast event": it's perfectly legal for IKEA and Hue devices to send more events within 0.5s. The check causes mismatches in x000/x001/x003 sequences. I think we need to whitelist the devices for which this check is needed, if at all. The double events for IKEA are all due to the device sending the command twice, once by groupcast and once by unicast; as a remedy, I simply ignore the unicast.

@manup
Copy link
Member

manup commented Mar 27, 2021

@manup, @SwoopX please note that I commented out the check for "too fast event": it's perfectly legal for IKEA and Hue devices to send more events within 0.5s. The check causes mismatches in x000/x001/x003 sequences. I think we need to whitelist the devices for which this check is needed, if at all. The double events for IKEA are all due to the device sending the command twice, once by groupcast and once by unicast; as a remedy, I simply ignore the unicast.

This was introduced in v2.5.33 in 2018 0f89afe due problems with Busch Jaeger switches 0ed3d17 So it might be that these are the only ones (or perhaps it isn't needed at all anymore).

@manup manup added this to the v2.11.0-beta milestone Mar 27, 2021
@ebaauw
Copy link
Collaborator Author

ebaauw commented Mar 27, 2021

I commented out the check for "too fast event"

This was introduced in v2.5.33 in 2018 0f89afe due problems with Busch Jaeger switches 0ed3d17 So it might be that these are the only ones (or perhaps it isn't needed at all anymore).

If it's no longer needed, let's please remove it. If still needed, can we whitelist Busch Jaeger on manufacturer code or manufacturer name, or do we need each model identifier? Alternatively, I could blacklist manufacturer codes for Philips and IKEA. Not sure if there's other devices that have come to rely on this check.

@manup
Copy link
Member

manup commented Mar 27, 2021

If it's no longer needed, let's please remove it. If still needed, can we whitelist Busch Jaeger on manufacturer code or manufacturer name, or do we need each model identifier? Alternatively, I could blacklist manufacturer codes for Philips and IKEA. Not sure if there's other devices that have come to rely on this check.

That's a good question I can't test the BJ switch currently. Would like to remove this code as well, but I guess the safest bet is to disable it for IKEA and Philips since these are the ones we can be certain?

Disable check for "too fast event" for Hue and IKEA devices, but enable it for others.
@ebaauw
Copy link
Collaborator Author

ebaauw commented Mar 27, 2021

the safest bet is to disable it for IKEA and Philips since these are the ones we can be certain?

Done.

@manup manup merged commit a8d6400 into dresden-elektronik:master Mar 27, 2021
manup added a commit to manup/deconz-rest-plugin that referenced this pull request Apr 6, 2021
manup added a commit to manup/deconz-rest-plugin that referenced this pull request Apr 22, 2021
Access to deCONZ::Node wasn't checked for nullptr and could crash when a button was pressed for a sensor which doesn't have the node set.

- SEGV since v2.11.0  PR: dresden-elektronik#4627
- Related issue: dresden-elektronik#4766
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.

Device Request IKEA STYRBAR
2 participants