Xiaomi Wireless Switch Click action issue
Moderator: leecollings
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Xiaomi Wireless Switch Click action issue
I have build a scenario, where I am using Wireless Switch by Xiaomi (a round one) + great AC Dimmer by trackerj. More on this and initial movie, showing current scenario here.
All is working fine in general, but there is a small issue.
My current blocky uses Click action to power on the lights and Double Click to power off the lights. It also uses Long Click to dim the lights, but that is irrelevant to my issue.
Here is current blocky: I would like to replace the Double Click action used to power down the lights with another Click action. So the end result would be: if the lights would be on, turn them off and if they are off, turn them on.
If I replace the current Double Click state (mind you, Xiaomi switch is a selector in Domoticz), for some reason it is switching permanently between on and off state. After troubleshooting, I have realised, Click is the permanent action and hence gets triggered all the time. So I have added the Set state to Off in the blocky you can see above, but this does not seem to be working. The Off state is not set by blocky.
Any ideas?
All is working fine in general, but there is a small issue.
My current blocky uses Click action to power on the lights and Double Click to power off the lights. It also uses Long Click to dim the lights, but that is irrelevant to my issue.
Here is current blocky: I would like to replace the Double Click action used to power down the lights with another Click action. So the end result would be: if the lights would be on, turn them off and if they are off, turn them on.
If I replace the current Double Click state (mind you, Xiaomi switch is a selector in Domoticz), for some reason it is switching permanently between on and off state. After troubleshooting, I have realised, Click is the permanent action and hence gets triggered all the time. So I have added the Set state to Off in the blocky you can see above, but this does not seem to be working. The Off state is not set by blocky.
Any ideas?
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 37
- Joined: Wednesday 25 January 2017 20:54
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Xiaomi Wireless Switch Click action issue
just add a 1 sec delay to the switch, should be enough
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Unfortunately, this does not suffice.pikapt wrote:just add a 1 sec delay to the switch, should be enough
For some reason, Off is not set on the selector. I have even tried to replace text "Off" with standard Off state, but then selector behaves strangely: both actions stay marked on the selector: Off and Click.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 37
- Joined: Friday 20 January 2017 8:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Hi Michal,
On my side, "Off" state of the Xiaomi Switch has been set up inside the selector configuration (with a 5 seconds delay) and not inside my blocky(ies).
Please also have a look, still inside the selector configuration of the selector levels order:
00 Off
10 Click
20 Long click
30 Long click release
40 Double click
On my side, "Off" state of the Xiaomi Switch has been set up inside the selector configuration (with a 5 seconds delay) and not inside my blocky(ies).
Please also have a look, still inside the selector configuration of the selector levels order:
00 Off
10 Click
20 Long click
30 Long click release
40 Double click
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Can you provide the screenshot or explain, how the Off state is set automatically in your case?lamouette wrote:Hi Michal,
On my side, "Off" state of the Xiaomi Switch has been set up inside the selector configuration (with a 5 seconds delay) and not inside my blocky(ies).
Please also have a look, still inside the selector configuration of the selector levels order:
00 Off
10 Click
20 Long click
30 Long click release
40 Double click
In my case, I have Off state created automatically, but the Selector normally stays on the action last executed, so if Xiaomi sets Click, Click action stays. That is why, in my blocky I am trying to set Off via Set in reaction to Click action.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 37
- Joined: Friday 20 January 2017 8:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Sure, here it is :
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Yes, so this is what I set, but to 1s. Yet this does not change the state of the Selector. After Click action, the selector stays on Click, does not switch to Off state.
Edit: Wait, this seems to be working now
Edit 2: I need to check the rest. If I have just Click and Double Click actions and your delay, Selector switches to off. But as soon as I change the second If in my blocky from Double Click, to Click, the Click is invoked and never changes to Off and my lights go crazy.
Edit: Wait, this seems to be working now
Edit 2: I need to check the rest. If I have just Click and Double Click actions and your delay, Selector switches to off. But as soon as I change the second If in my blocky from Double Click, to Click, the Click is invoked and never changes to Off and my lights go crazy.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 37
- Joined: Friday 20 January 2017 8:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Here is my setup.
I have 2 blockies, setting up the status of a group.
I am not a big fan of "Else if"
And the scene is the following:
I have 2 blockies, setting up the status of a group.
I am not a big fan of "Else if"
And the scene is the following:
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Xiaomi Wireless Switch Click action issue
I haven't looked into your script yet, but can you confirm you have the same states as lamouette for the switch? -mKotek wrote: Any ideas?
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 37
- Joined: Friday 20 January 2017 8:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Next step will be to remove the switch from the device list and add it again by a refresh of the gateway hardware within domoticz
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Yes, I have removed the switch and added it back again when Long Click Release has been added and I have exactly the same set of actions on the selector.corbin wrote:I haven't looked into your script yet, but can you confirm you have the same states as lamouette for the switch? -mKotek wrote: Any ideas?
xiaomi_states.PNG
I am now thinking about simplyfing the blocky to include only check for Click event and the status of the variable and disregard the condition about Lights being not Off in the second Click check.
Last edited by mKotek on Friday 10 February 2017 10:39, edited 1 time in total.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
I am also not a big fan of else if, but what I am trying to achieve is to act on Click action depending on whether at least one light is on or off.lamouette wrote:Here is my setup.
I have 2 blockies, setting up the status of a group.
I am not a big fan of "Else if"
Capture.PNG
Capture1.PNG
And the scene is the following:
Capture2.PNG
The scenario you have shown with Click and Double Click works fine in my case. I am trying to replace Double Click with Click, so that it works once to turn the lights on and then again to turn lights off.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 37
- Joined: Friday 20 January 2017 8:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Why don't you set "LampaBorysa_K1" and "LampaBorysa_K2" to "On" ?
Mistake on your Else If, in the "or", you check two times "LampaBorysa_K1"
Mistake on your Else If, in the "or", you check two times "LampaBorysa_K1"
-
- Posts: 68
- Joined: Wednesday 30 December 2015 23:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Poland
- Contact:
Re: Xiaomi Wireless Switch Click action issue
I have corrected this (have missed that completely, so thank you), but this has not solved the problem.lamouette wrote:Why don't you set "LampaBorysa_K1" and "LampaBorysa_K2" to "On" ?
Mistake on your Else If, in the "or", you check two times "LampaBorysa_K1"
I have even removed the whole AND part of the second click, leaving only variable check, but still the disco lights start when only I replace Double Click with Click. Will need to debug piece by piece.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Posts: 1
- Joined: Tuesday 12 December 2017 11:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Wireless Switch Click action issue
how about this for a solution:
set your switch delay at 1 seconds.
then when "click" is selected
set first switch to off
then lamp on after 2 seconds.
this prevents that the state of the lamp is seen "on" at the same time that the switch is in state "click"
set your switch delay at 1 seconds.
then when "click" is selected
set first switch to off
then lamp on after 2 seconds.
this prevents that the state of the lamp is seen "on" at the same time that the switch is in state "click"
- Attachments
-
- Knipsel.JPG (46.1 KiB) Viewed 10233 times
-
- Posts: 37
- Joined: Wednesday 10 December 2014 21:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Netherlands
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Hi mKotek,
Are you still having issue’s to set the wireless switch to OFF?
I find the answer, you need the logic OFF in blockly, and not the text logic where you fill in the “state of wired switch”!
The text box in blockly is used for the other states, like “click” etc etc.
Make sure that the off state in the device is also set to 0.
Hopefully this will help.
Best regards, John
Are you still having issue’s to set the wireless switch to OFF?
I find the answer, you need the logic OFF in blockly, and not the text logic where you fill in the “state of wired switch”!
The text box in blockly is used for the other states, like “click” etc etc.
Make sure that the off state in the device is also set to 0.
Hopefully this will help.
Best regards, John
Raspi 3B+; Razberry zwave; zigbee; lots and lots of sensors
-
- Posts: 12
- Joined: Tuesday 25 September 2018 12:38
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10327
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Does this also work with the Wireless Wall Switch? I want to use this switch for turning on/off HUE light, but this doesn't work.
I added the switch to domoticz and changed to type selector, created a blockly with "Click" and "Double Click" but no response of the HUE bulb.
And when I click on the switch itself it always gives as data "Off" in the log.
How can I get this thing working?
I added the switch to domoticz and changed to type selector, created a blockly with "Click" and "Double Click" but no response of the HUE bulb.
And when I click on the switch itself it always gives as data "Off" in the log.
How can I get this thing working?
-
- Posts: 1
- Joined: Sunday 30 September 2018 20:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Wireless Switch Click action issue
I have the same question. Can't seem to get my group to turn on or off when one of the buttons of the xiaomi wireless dual switch is clicked.
Any help is appreciated.
@madvision. The data "off" is because the unit itself will switch to Off after a some seconds, as mentioned above.
Any help is appreciated.
@madvision. The data "off" is because the unit itself will switch to Off after a some seconds, as mentioned above.
-
- Posts: 12
- Joined: Tuesday 25 September 2018 12:38
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10327
- Contact:
Re: Xiaomi Wireless Switch Click action issue
I didn't setup a Off delay so the device doesn't switch to off after some seconds.
When I set a Off delay the light is going into a loop on/off/on/off etc.
I also switched back to type "Push On button" which is set as default when you add the Xiaomi Wireless Wall Switch (single button) to Domoticz. The device in Domoticz is working with type selector, but not with the physical device itself. It always returns "Off" in log by every click.
The problem is that type "push on button" always gives a ON status when you click on the device and I can't figure out how to manage to create a toggle so the lamp is going ON when it's OFF and OFF when it's ON at every click.
Does someone has this working already with the Xiaomi/Aqara Wireless Wall Switch (single button)?
If so, please share your config.
When I set a Off delay the light is going into a loop on/off/on/off etc.
I also switched back to type "Push On button" which is set as default when you add the Xiaomi Wireless Wall Switch (single button) to Domoticz. The device in Domoticz is working with type selector, but not with the physical device itself. It always returns "Off" in log by every click.
The problem is that type "push on button" always gives a ON status when you click on the device and I can't figure out how to manage to create a toggle so the lamp is going ON when it's OFF and OFF when it's ON at every click.
Does someone has this working already with the Xiaomi/Aqara Wireless Wall Switch (single button)?
If so, please share your config.
-
- Posts: 4
- Joined: Sunday 14 October 2018 9:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Wireless Switch Click action issue
Hi there,
I got my XIaomi switches working with multiple scenes on one action, see the code below. In that example I used the Double Click action to switch between 3 different scenes, you can do it with 2 scenes (1 with your light-s on, 1 with the light-s off) and it should work just fine.
Hope it helps!
I got my XIaomi switches working with multiple scenes on one action, see the code below. In that example I used the Double Click action to switch between 3 different scenes, you can do it with 2 scenes (1 with your light-s on, 1 with the light-s off) and it should work just fine.
Hope it helps!
- Attachments
-
- Screen Shot 2018-10-14 at 14.30.35.png (118.32 KiB) Viewed 6370 times
Who is online
Users browsing this forum: No registered users and 1 guest