Xiaomi switch and LED problem. Please help

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

Xiaomi switch and LED problem. Please help

Post by Arczipl » 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

User avatar
mrf68
Posts: 224
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by mrf68 » Sunday 10 September 2017 17:15

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".
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

Arczipl
Posts: 5
Joined: Friday 08 September 2017 23:44
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by Arczipl » Sunday 10 September 2017 20:40

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

User avatar
mrf68
Posts: 224
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by mrf68 » Monday 11 September 2017 22:28

Open Blockly editor and press "Show current states". Look for your switch and the status it has.
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

theo69
Posts: 72
Joined: Sunday 04 June 2017 12:57
Target OS: Raspberry Pi
Domoticz version: la. beta
Location: World
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by theo69 » Monday 11 September 2017 22:35

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

User avatar
mrf68
Posts: 224
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by mrf68 » Tuesday 12 September 2017 6:41

Sorry, my bad, these switches seem to send status "click". i assumed it to be "on" or "off".
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

Arczipl
Posts: 5
Joined: Friday 08 September 2017 23:44
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by Arczipl » Tuesday 12 September 2017 15:24

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 » Wednesday 27 September 2017 9:50

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 504 times

whatisk
Posts: 5
Joined: Sunday 15 October 2017 6:13
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: Australia
Contact:

Re: Xiaomi switch and LED problem. Please help

Post by whatisk » Sunday 15 October 2017 6:19

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 328 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 1 guest