Skip to content
This repository has been archived by the owner. It is now read-only.

Xiaomi WXKG02LM first press not registering #123

Closed
cappadanna opened this issue Jan 25, 2019 · 24 comments
Closed

Xiaomi WXKG02LM first press not registering #123

cappadanna opened this issue Jan 25, 2019 · 24 comments
Labels

Comments

@cappadanna
Copy link

@cappadanna cappadanna commented Jan 25, 2019

Hi. I’m using two Xiaomi WXKG02LM switches controlling a couple of Ikea bulbs using a RPi with Raspbee. I have them setup for toggling the bulbs on/off in the Phoscon app.

The problem is that often the first press won’t register to turn on/off the lights. I often have to press them a second time.

However, i can see the Xiaomi switches sending commands the first time since i see them ”bouncing” in the Apple home app (using homebridge hue)

Anyone have had any similar problem?

2.05.57 with fw. 26300500

@bdickhaus
Copy link
Collaborator

@bdickhaus bdickhaus commented Jan 25, 2019

I have one that does the same thing. I've also had it completely disconnect when I didn't use it for a long time. I had to rediscover it.

@manup
Copy link
Member

@manup manup commented Jan 26, 2019

I have them setup for toggling the bulbs on/off in the Phoscon app.

Was the configuration done with Phoscon App switch editor or Apple home app?
Can you please show the configuration for that button?

@cappadanna
Copy link
Author

@cappadanna cappadanna commented Jan 26, 2019

The configuration for toggling was done in the Phoscon app. A have a double-press configured through the Apple home app but have tried deleting it, doesn't change. I have removed the switches and reconnected them. Even tried with a fresh install of my RPi.

I've found that i can fool it:
If i turn the bulb off in the apple home app and press the switch, the press is registered but the bulb isn't turned on. (and same the other way around) It's like it is sending an off command again when it should be an on command. Does the software read the state of the bulb (on or off) before it sends the command?

I hope i'm making sense to you :)

skarmavbild 2019-01-26 kl 10 58 20

skarmavbild 2019-01-26 kl 11 00 49

@ebaauw
Copy link
Collaborator

@ebaauw ebaauw commented Jan 26, 2019

Doesn't Phoscon send a Toggle command?

I often find that after (re-)starting deCONZ, it takes a while before the REST API correctly reflects the light states. Typically, it reports a lot of lights as on, while they're actually off. When looking at the state to determine whether to send On of Off it will send Off for the first press, wrongly thinking some of the lights are on.

@manup
Copy link
Member

@manup manup commented Jan 26, 2019

Nope, currently we use a CLIPGenericFlag which is toggled between true/false.
And I think this is the very problem here.

What likely happens is:

  • CLIPGenericFlag = true
  • Group = off
  • On first button press Off command is sent... and nothing happens ;)
  • Only the second button press will send the desired On command

I'll put it on the todo list for next versions, maybe 2.05.59. group.state.any_on might be a better approach here.

@ebaauw
Copy link
Collaborator

@ebaauw ebaauw commented Jan 26, 2019

Note that, on restarting deCONZ,

  • The CLIP's state.flag resets to false; and
  • The group's state.any_on might not reflect the actual light states, until all lights have been polled.

I used to workaround the second issue by turning off all lights after restart, using a series of gateway rules (triggered by the Daylight sensor being updated on startup). This forces the REST API to reflect the actual light state, and is great when recovering from power failure, but has the disadvantage of leaving me in the dark when just restarting deCONZ. With the poweron settings for the Hue lights, I no longer need the power failure recovery workaround. For now, I accept the temporary mismatch after restart - deCONZ runs brilliantly stable on my Raspberry, so any restart is initiated manually by me anyways.

Meybe it's an idea to reset the light state.on (and group state,any_on, state.all_on) to false on restart? I think that's also done for the ZHAPresence sensor's state.presence?

@cappadanna
Copy link
Author

@cappadanna cappadanna commented Jan 26, 2019

Nope, currently we use a CLIPGenericFlag which is toggled between true/false.
And I think this is the very problem here.

What likely happens is:

  • CLIPGenericFlag = true
  • Group = off
  • On first button press Off command is sent... and nothing happens ;)
  • Only the second button press will send the desired On command

I'll put it on the todo list for next versions, maybe 2.05.59. group.state.any_on might be a better approach here.

That must be what causes it. Now at least i understand what is happening :) Thank you! Keep up the good work!

@johanhansen
Copy link

@johanhansen johanhansen commented Feb 12, 2019

I have also observed the same problem. Using a Xiaomi wall switch configured to toggle, it functions as expected as long as I don't control the linked light in Home.app. Once I do that the state is out of sync between the state of the light and the CLIP-sensor.

Toggeling the light using Home.app should also trigger the CLIP-sensor to toggle. Right?

@Oliviakrkk
Copy link

@Oliviakrkk Oliviakrkk commented Apr 7, 2019

Hi @manup

Any updates on those switches? I have similar issue. But sometimes I have to press button multiple times to make it work.

@stale
Copy link

@stale stale bot commented Aug 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@cappadanna
Copy link
Author

@cappadanna cappadanna commented Aug 5, 2019

Is this still on the todo list? 😊

@jo-me
Copy link

@jo-me jo-me commented Aug 25, 2019

Same issue here...

@manup
Copy link
Member

@manup manup commented Aug 25, 2019

The problem is fixed and will be part of the upcoming 2.05.67.
Sorry took way longer than anticipated.

@manup
Copy link
Member

@manup manup commented Aug 27, 2019

https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/V2_05_67

The issue is fixed in 2.05.67, but you need to update or re-create the switch button assignment.

@nihj
Copy link

@nihj nihj commented Dec 22, 2019

Hi,

I'm still having this exact issue with my WXKG11LM (I know that's not the switch the issue was reported on byt I assume the fix is somewhat generic...?), even though I'm currently using version 2.05.72.

There was a mentioning of having to redo or update the key assignments, could you clarify that a bit @manup ? I (think I) have re-done my key assignments multiple times now but to no avail.

@nihj
Copy link

@nihj nihj commented Feb 8, 2020

Ping @manup

I'm still experiencing this problem, even though I'm currently using version 2.05.72.

There was a mentioning of having to redo or update the key assignments, could you clarify that a bit? I (think I) have re-done my key assignments multiple times now but to no avail.

@Mimiix
Copy link
Collaborator

@Mimiix Mimiix commented Jun 5, 2020

Is this still a issue?

@nihj
Copy link

@nihj nihj commented Jun 11, 2020

This is technically not an issue, because when using the "Toggle" action it actually works, the first press is registered.

However, the problem still occurs when using the "Toggle dimming up/down, on/off" functionality. I was using this, very nifty, feature when I "still was not able to get it working" in my comments above and have now stopped using that.

So, follow up question: was tis fix explicitly put on ONLY the code path of the "Toggle" action, and if so would it be possible to also fix it for "Toggle dimming up/down, on/off"? It's really handy and I'd like to be able to use it again.

@Mimiix
Copy link
Collaborator

@Mimiix Mimiix commented Jun 11, 2020

@nihj I'm going to hand this over to @YKO-de as she is the dev of Phoscon. I will move this issue to their repository. She is the perfect person for your question ;)

@Mimiix Mimiix transferred this issue from dresden-elektronik/deconz-rest-plugin Jun 11, 2020
@ausminternet
Copy link

@ausminternet ausminternet commented Oct 21, 2020

However, the problem still occurs when using the "Toggle dimming up/down, on/off" functionality. I was using this, very nifty, feature when I "still was not able to get it working" in my comments above and have now stopped using that.

Same here, still not working for the combined toggle/dimming action.

@YKO-de
Copy link
Contributor

@YKO-de YKO-de commented Oct 22, 2020

@ausminternet I think I have found the mistake. Could you please test it once at phoscon.de/pwabeta and give me some feedback? Just delete the rule again and create a new one. Thanks

@stale
Copy link

@stale stale bot commented Nov 15, 2020

As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 15, 2020
@stale
Copy link

@stale stale bot commented Nov 24, 2020

As there hasn't been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it isn't solved, request to get this opened again.

@stale stale bot closed this as completed Nov 24, 2020
@ausminternet
Copy link

@ausminternet ausminternet commented Nov 24, 2020

Sorry for the delay. @YKO-de it worked like a charm, thx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests