question, I know it's more an issue in Domoticz then in ESPEasy firmware.
But maybe anybody here found a solution for this

When I use http requests in the On/Off action, it takes aprox. 1sec when action is executed.
e.g.
Code: Select all
http://<ESP IP address>/control?cmd=GPIO,<pin>,1

So I moved to LUA script, that makes it all a bit faster aprox ~200ms
Sometimes a bit faster, sometimes slower.
I can currently live with that

Code: Select all
if devicechanged["kerstboom"] then
IP = "192.168.0.100";
RELAYPIN = 5;
print ("kerstboom trigered!");
if(devicechanged["kerstboom"]=='Off') then
runcommand = "curl http://" .. IP .. "/control?cmd=gpio," ..RELAYPIN.. ",1" .. " ";
print("Relaypin " .. RELAYPIN .. " OFF command " .. runcommand);
os.execute(runcommand);
else if(devicechanged["kerstboom"]=='On') then
runcommand = "curl http://" .. IP .. "/control?cmd=gpio," ..RELAYPIN.. ",0" .. " ";
print("Relaypin " .. RELAYPIN .. " ON command " .. runcommand);
os.execute(runcommand);
end
end
Code: Select all
2017-01-17 17:10:19.956 User: domoticz initiated a switch command (13/kerstboom/Off)
2017-01-17 17:10:20.187 LUA: kerstboom trigered!
2017-01-17 17:10:20.187 LUA: Relaypin 5 OFF command curl http://192.168.0.100/control?cmd=gpio,5,1
But, when I do multiple calls at the same time by changing the commandArray, it's extremely slow.
For 3 calls it takes aprox ~2.5sec ok, it do work, but its sloooow

Code: Select all
commandArray['kerstboom']='Off'
commandArray['keuken_dimmer']='Off'
commandArray['living_verlichting']='Off'
Code: Select all
2017-01-17 17:12:33.745 User: domoticz initiated a switch command (20/livingkeuken/On)
2017-01-17 17:12:33.995 LUA: alles uit trigered!
2017-01-17 17:12:33.999 EventSystem: Script event triggered: customevent
2017-01-17 17:12:33.749 (ESPEasy nodemcu 1 0.231) Light/Switch (livingkeuken)
2017-01-17 17:12:34.226 LUA: kerstboom trigered!
2017-01-17 17:12:34.226 LUA: Relaypin 5 ON command curl http://192.168.0.100/control?cmd=gpio,5,0
2017-01-17 17:12:34.003 (ESPEasy nodemcu 2 0.100) Light/Switch (kerstboom)
2017-01-17 17:12:35.015 LUA: living_verlichting trigered!
2017-01-17 17:12:35.015 LUA: Relaypin 13 ON command curl http://192.168.0.231/control?cmd=gpio,13,1
2017-01-17 17:12:34.780 (ESPEasy nodemcu 1 0.231) Light/Switch (living_verlichting)
2017-01-17 17:12:35.706 LUA: ON dimm stored value = 716
2017-01-17 17:12:35.706 LUA: Relaypin 5 ON command curl http://192.168.0.231/control?cmd=gpio,5,0
2017-01-17 17:12:36.558 LUA: PWM calculated value= 716
2017-01-17 17:12:35.445 (ESPEasy nodemcu 1 0.231) Light/Switch (keuken_dimmer)
I'm sure if I would write a C# console app, I could call multithreaded 3 json call's and the result would be instant.
But that's not possible in Domoticz, or am I wrong?
Does anybody know what I could try or change?

