What am i doing wrong? i used the checkFirst?
Also the logging gives multiple ON commands
0 Uit
10 10seconds
20 20seconds
30 30seconds
etc.
Code: Select all
return {
on = {devices = {'Tuinirrigatie_borders'}},
logging = { level = domoticz.LOG_DEBUG ,marker = actOnIdleDevices },
execute = function(dz, device, info)
local waarde = tonumber(device.state)
if device.state == '0' then
device.switchOff()
dz.log("Script: " .. info.scriptName .. " Device uitgezet....", dz.LOG_INFO)
else
device.switchOn().checkFirst().forSec(waarde)
dz.log("Script: " .. info.scriptName .. " Device voor " .. tostring(waarde) .. "secondes aangezet....", dz.LOG_INFO)
end
end
}
Code: Select all
2019-02-17 17:32:41.091 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.091 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.091 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.091 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.092 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.093 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.217 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.217 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.218 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.218 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.218 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.220 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.428 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.429 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.429 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.429 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.429 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.430 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.541 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.541 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.541 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.541 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.541 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.543 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.667 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.667 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.667 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.667 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.667 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.669 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.793 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.793 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.794 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.794 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.794 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.795 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:41.917 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:41.917 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:41.917 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS
2019-02-17 17:32:41.917 Status: dzVents: Info: Script: DZ_Irrigatie Device voor 10secondes aangezet....
2019-02-17 17:32:41.917 Status: dzVents: Info: ------ Finished DZ_Irrigatie
2019-02-17 17:32:41.919 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-02-17 17:32:42.070 (dummydevices) Light/Switch (Tuinirrigatie_borders)
2019-02-17 17:32:42.044 Status: dzVents: Info: ------ Start internal script: DZ_Irrigatie: Device: "Tuinirrigatie_borders (dummydevices)", Index: 1188
2019-02-17 17:32:42.044 Status: dzVents: Debug: Constructed timed-command: On
2019-02-17 17:32:42.044 Status: dzVents: Debug: Constructed timed-command: On FOR 10 SECONDS