Here is my problem:
I try to send simple command to switches through Lua scripting in order to "dupplicate" a command when it is triggered One. Short explanation:
I have blinds interfaced with a Chacon 54754 switch and a RF433 remote control. I have created a blind switch "Fixe Haut" that send same order that the remote control. It works well but... My blinds requieres an impulse whereas the Chacon module maintain the order for 2 minutes. The solution is to send again the same command to make the Chacon switch to release the order. This mean I need to push the button twice for the command appropriatelly.
First solution:
I created a scenario in witch in included my Domoticz switch twice with a delay of 1 seconds and it works ... except when I use the remote control.
Second Solution:
I tried to create a Lua Script to trigger the event coming from the Remote Control or the Domoticz switch "Fixe Haut".
here is the code:
Code: Select all
commandArray = {}
if (devicechanged['Fixe haut'] == 'Open') then
print (" ---- Envoi commande Open sur Fixe Haut" )
oss = "curl 'http://192.168.0.39:8080/json.htm?type=command¶m=udevice&idx=119&nvalue=1&svalue=Open'&"
os.execute(oss)
-- commandArray={['Fixe haut']='Open AFTER 3'}
elseif (devicechanged['Fixe haut'] == 'Close') then
print (" ---- Envoi commande Closed sur Fixe Haut" )
oss = "curl 'http://192.168.0.39:8080/json.htm?type=command¶m=udevice&idx=119&nvalue=0&svalue=Closed'&"
os.execute(oss)
-- commandArray={['Fixe haut']='Closed AFTER 3'}
end
return commandArray
The script is executing, and the switch change is triggered ( I can see the comment in the log ), but nothing happen.
I tried to execute the http command directly in my Chrome Brower and I have a "OK" as a result in the brower ... but no activation of the switch, and when I look in Domoticz, the state of the Fixe Haut switch has changed.
So it seems the order has not been send to the switch through the RFCOM RF433 module.
My domoticz is running of Raspberry Pi.
What did I do wrong?
Thanks for your help,
regards,
Pierre