Xiaomi switch and LED problem. Please help

Moderator: leecollings

Post Reply
Arczipl
Posts: 6
Joined: Friday 08 September 2017 23:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Xiaomi switch and LED problem. Please help

Post 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
mrf68

Re: Xiaomi switch and LED problem. Please help

Post 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".
Arczipl
Posts: 6
Joined: Friday 08 September 2017 23:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by Arczipl »

"ON" and "OFF" stats not working. Any more ideas?:(
mrf68

Re: Xiaomi switch and LED problem. Please help

Post by mrf68 »

Open Blockly editor and press "Show current states". Look for your switch and the status it has.
theo69
Posts: 60
Joined: Sunday 04 June 2017 12:57
Target OS: Raspberry Pi / ODroid
Domoticz version: la. beta
Location: World
Contact:

Re: Xiaomi switch and LED problem. Please help

Post 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
Love my Xiaomi Gateway in connection with homebridge and domoticz on my PI3
Xiaomi Gateway Domoticz Wiki
mrf68

Re: Xiaomi switch and LED problem. Please help

Post by mrf68 »

Sorry, my bad, these switches seem to send status "click". i assumed it to be "on" or "off".
Arczipl
Posts: 6
Joined: Friday 08 September 2017 23:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Xiaomi switch and LED problem. Please help

Post 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?
apinyot
Posts: 2
Joined: Wednesday 27 September 2017 9:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Xiaomi switch and LED problem. Please help

Post 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.
Attachments
Captura.PNG
Captura.PNG (17.64 KiB) Viewed 2045 times
whatisk
Posts: 27
Joined: Sunday 15 October 2017 6:13
Target OS: Linux
Domoticz version: 3.9224
Location: Australia
Contact:

Re: Xiaomi switch and LED problem. Please help

Post 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 1869 times
Anyone have any suggestions as to where the issue may be?
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests