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

Xiaomi WXKG02LM first press not registering #1181

Open
cappadanna opened this issue Jan 25, 2019 · 14 comments

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

This comment has been minimized.

Copy link

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

@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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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.

@stale stale bot added the stale label Aug 5, 2019
@cappadanna

This comment has been minimized.

Copy link
Author

@cappadanna cappadanna commented Aug 5, 2019

Is this still on the todo list? 😊

@stale stale bot removed the stale label Aug 5, 2019
@jo-me

This comment has been minimized.

Copy link

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

Same issue here...

@manup

This comment has been minimized.

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

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.