Page 1 of 1

Xiaomi switch and LED problem. Please help

Posted: Sunday 10 September 2017 12:03
by Arczipl
Hello,
I have a problem with blockly event.
I have a xiaomi switch / selector and I would like to click on (one click) the switch lit up and after next click (one click) turned off the LED. It would be ideal if this click activated a group or scene. I did this event as in the photo and unfortunately, but after clicking on the LED turns on but after another it does not turn off permanently. Turns off for a moment and then lights up again.
Please help and tell me what is wrong. Maybe someone is able to translate this into dzVents?
Below the screen of the event, switch / selector settings and user variables

Image

Re: Xiaomi switch and LED problem. Please help

Posted: Sunday 10 September 2017 17:15
by mrf68
Hello,

Maybe when you press the switch you hear a "click" but I suppose it's not the status that it sends to Domoticz. Try "On" or "Off".

Re: Xiaomi switch and LED problem. Please help

Posted: Sunday 10 September 2017 20:40
by Arczipl
"ON" and "OFF" stats not working. Any more ideas?:(

Re: Xiaomi switch and LED problem. Please help

Posted: Monday 11 September 2017 22:28
by mrf68
Open Blockly editor and press "Show current states". Look for your switch and the status it has.

Re: Xiaomi switch and LED problem. Please help

Posted: Monday 11 September 2017 22:35
by theo69
Arczipl wrote: Sunday 10 September 2017 12:03 Hello,
I have a problem with blockly event.
I have a xiaomi switch / selector and I would like to click on (one click) the switch lit up and after next click (one click) turned off the LED. It would be ideal if this click activated a group or scene. I did this event as in the photo and unfortunately, but after clicking on the LED turns on but after another it does not turn off permanently. Turns off for a moment and then lights up again.
Please help and tell me what is wrong. Maybe someone is able to translate this into dzVents?
Below the screen of the event, switch / selector settings and user variables

Image
Try lua instead:

commandArray = {}
if devicechanged['Xiaomi Switch'] == 'Click' then
if otherdevices['Xiaomi Router LED'] == 'Off' then
commandArray['Xiaomi Router LED'] = 'On'
else
commandArray['Xiaomi Router LED'] = 'Off'
end
end
return commandArray

Re: Xiaomi switch and LED problem. Please help

Posted: Tuesday 12 September 2017 6:41
by mrf68
Sorry, my bad, these switches seem to send status "click". i assumed it to be "on" or "off".

Re: Xiaomi switch and LED problem. Please help

Posted: Tuesday 12 September 2017 15:24
by Arczipl
Try lua instead:

commandArray = {}
if devicechanged['Xiaomi Switch'] == 'Click' then
if otherdevices['Xiaomi Router LED'] == 'Off' then
commandArray['Xiaomi Router LED'] = 'On'
else
commandArray['Xiaomi Router LED'] = 'Off'
end
end
return commandArray
It'working :) Thank's my freinds:) Tell me, what I must change to working with scenes/group?

Re: Xiaomi switch and LED problem. Please help

Posted: Wednesday 27 September 2017 9:50
by apinyot
I have the following blocky and it works perfectly. I have two "If/do" instead of "if/do/else if/do".

Hope it helps.

Re: Xiaomi switch and LED problem. Please help

Posted: Sunday 15 October 2017 6:19
by whatisk
Thought I would post here rather than create a new thread.

Brand new to Domoticz and I have tried doing a similar thing.
If I use the same Blocky as the original post, the LED on the Gateway continually flicks on and off.
If I try apinyot solution, it does nothing at all.
If I try theo solution (LUA) it also does nothing.

The below works, but there is no way to turn off/toggle the light
Capture.JPG
Capture.JPG (16.18 KiB) Viewed 1874 times
Anyone have any suggestions as to where the issue may be?
Thanks.