sending multiple GPIO states to ESPeasy
Posted: Sunday 05 January 2020 20:13
Hi
I have a ventilation system i can control with an ESPEasy device, by sending URLs to it.
In Domoticz i have a multiselector switch and a LUA script like this:
However it does not work, as it seems it only change the state of one of the GPIO. Typing the URL's directly in the browser works fine. So is my script right or is there some timing issues?
Thanks
I have a ventilation system i can control with an ESPEasy device, by sending URLs to it.
In Domoticz i have a multiselector switch and a LUA script like this:
Code: Select all
commandArray = {}
if devicechanged['Ventilation'] == 'Off' then
print ("Ventilation switched to Off")
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,13,1' --switch off High
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,12,1' --switch off Normal
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,14,1' --switch off Low
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,16,1' --switch off unit
elseif devicechanged['Ventilation'] == 'Low' then
print ("Ventilation switched to Low")
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,16,0' --switch on unit
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,13,1' --switch off High
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,12,1' --switch off Normal
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,14,0' --switch on Low
elseif devicechanged['Ventilation'] == 'Normal' then
print ("Ventilation switched to Normal")
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,16,0' --switch on unit
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,13,1' --switch off High
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,14,1' --switch off Low
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,12,0' --switch on Normal
elseif devicechanged['Ventilation'] == 'High' then
print ("Ventilation switched to High")
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,16,0' --switch on unit
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,12,1' --switch off Normal
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,14,1' --switch off Low
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,13,0' --switch on High
elseif devicechanged['Ventilation'] == 'Auto' then
print ("Ventilation switched to Auto")
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,16,0' --switch on unit
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,13,1' --switch off High
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,12,1' --switch off Normal
commandArray['OpenURL']='http://ventilation/control?cmd=GPIO,14,1' --switch off Low
end
return commandArray
Thanks