xxLeoxx93 wrote:What is the easiest way to tell domoticz that when i doubleclick my switch it should turn of my xiaomi wallplug? I can only see to run a script when interacting with my switch?
commandArray = {}
-- Commande Selector Switch
if (devicechanged['Xiaomi Switch Micro-onde'] == 'Click') then
print("MicroOnde: Click ON for 10s")
commandArray[1]={['Xiaomi Smart Plug']='On'}
commandArray[2]={['Xiaomi Smart Plug']='Off AFTER 10'}
end
if (devicechanged['Xiaomi Switch Micro-onde'] == 'Double Click') then
print("MicroOnde: Double Click ON for 30s")
commandArray[1]={['Xiaomi Smart Plug']='On'}
commandArray[2]={['Xiaomi Smart Plug']='Off AFTER 30'}
end
if (devicechanged['Xiaomi Switch Micro-onde'] == 'Long Click' ) then
print("MicroOnde: Long Click ON for 2m")
commandArray['Xiaomi Smart Plug']='On FOR 2'
end
return commandArray
I've added an entry "1.5 lua scripts example" in the Wiki with this script.
Why sometimes the motion sensor isn't trigger on and nothing happen?
Edit:
corbin wrote:quote
(I quote just for tag) sometimes happen that the motion sensor not working so I need to update (click on button Update in Hardware section) Xiaomi service. So I think that there is some sort of problem in the timeout or something.
Some of my motion sensors don't always trigger immediately. Haven't had time to investigate further but I plan to compare Domoticz with the Mi Home app log.
corbin wrote:Some of my motion sensors don't always trigger immediately. Haven't had time to investigate further but I plan to compare Domoticz with the Mi Home app log.
In Mi App everything work great... and only sometimes happen, I don't know how.
There is a way to see the log of the signal sent by the Gateway?
mmm
Think i found a bug/problem...
Will try to use the remote button in blockley....
Only when i click 1 time...
The button is not going on, just change the tekst to click.
Only in blockley there is no click.
And on is not working.
other options?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
marcotini wrote:
In Mi App everything work great... and only sometimes happen, I don't know how.
There is a way to see the log of the signal sent by the Gateway?
So I setup an alert from the Mi Home app went motion is detected, and can confirm it was working properly too.
A reboot of Domoticz has helped with events not triggering immediately in Domoticz, indicating that is where the problem is. You can enable logging of messages received from the gateway (check the wiki), but I don't know if we can see a log of messages sent by the gateway.