Hi All,
I have the log running for a few days now the problem is still here. I now hw some debug log. I see the following in the log:
Code: Select all
2017-12-15 21:19:28.046 dzVents: Info: Frontdoor actions: ------ Start external script: frontdoor_V1-0-0.lua: Device: "Voordeur (RFXCOM)", Index: 140
2017-12-15 21:19:28.047 dzVents: Debug: Frontdoor actions: Device-adapter found for Halletje: Switch device adapter
2017-12-15 21:19:28.047 dzVents: Debug: Frontdoor actions: Processing device-adapter for Halletje: Switch device adapter
2017-12-15 21:19:28.048 dzVents: Debug: Frontdoor actions: Device-adapter found for Koof hoge kasten: Switch device adapter
2017-12-15 21:19:28.049 dzVents: Debug: Frontdoor actions: Processing device-adapter for Koof hoge kasten: Switch device adapter
2017-12-15 21:19:28.050 dzVents: Debug: Frontdoor actions: Device-adapter found for Schemerlamp lage kast: Switch device adapter
2017-12-15 21:19:28.050 dzVents: Debug: Frontdoor actions: Processing device-adapter for Schemerlamp lage kast: Switch device adapter
2017-12-15 21:19:28.051 dzVents: Debug: Frontdoor actions: Device-adapter found for Buitenlamp voor: Switch device adapter
2017-12-15 21:19:28.051 dzVents: Debug: Frontdoor actions: Processing device-adapter for Buitenlamp voor: Switch device adapter
2017-12-15 21:19:28.052 dzVents: Debug: Frontdoor actions: Device-adapter found for VirtualVerlichting: Switch device adapter
2017-12-15 21:19:28.053 dzVents: Debug: Frontdoor actions: Processing device-adapter for VirtualVerlichting: Switch device adapter
2017-12-15 21:19:28.053 dzVents: Info: Frontdoor actions: it is night
2017-12-15 21:19:28.053 dzVents: Debug: Frontdoor actions: Constructed timed-command: On
2017-12-15 21:19:28.053 dzVents: Debug: Frontdoor actions: Constructed timed-command: On FOR 2
2017-12-15 21:19:28.053 dzVents: Info: Frontdoor actions: ------ Finished frontdoor_V1-0-0.lua
And here is the code:
Code: Select all
execute = function(domoticz, switch)
local hallway = domoticz.devices('Halletje') -- hallway lamp variable
local kitchen = domoticz.devices('Koof hoge kasten')
local living = domoticz.devices('Schemerlamp lage kast')
local outdoorlamp = domoticz.devices('Buitenlamp voor') -- outdoor lamp variable
local lightState = domoticz.devices('VirtualVerlichting') -- virtual lights on dummy switch
-- Actions to execute when the frontdoor goes on (eg door is opened)
if (switch.state == 'On') then
if (domoticz.time.isNightTime) then
domoticz.log ('it is night')
hallway.switchOn().forMin(2)
if outdoorlamp.state == 'On' then
if (lightState.state == 'Off') then
kitchen.switchOn().afterSec(5)
living.switchOn().afterSec(10)
end
end
end
-- Actions to execute when the frontdoor goes off (eg door is closed)
else
end
end
@dannybloe: can you see anything stange?
Further I noticed something else. My outdoor lamp is also triggered by the forMin() command. Time is 10 minutes, so forMin(10). I see the following in the device log:
017-12-16 08:54:55 On
2017-12-16 08:44:55 On
2017-12-16 08:43:37 On
The script is triggered by a virtual presence script that is triggered by people coming home. You see to people coming home, at 08:43:37 and 08:44:55. Both trigger the script. You se the latest is triggering again exactly 10 minutes later with an on command! Where it should be off!
Does anyone have an explanation for that?
I hope someone can shine a light on this, The behaviour is unpredictable. Sometimes it works, sometimes not. So frustatating.
Thanks all!!
Ralph
RPi 3B (master): RFXtrx433, Harmony Hub, Z-Wave devices, CoCo units, Hue, Xiaomi Aquara
RPi 2B (slave): P1 connection, MySensors with custom built watermeter sensors on Aquadis+
RPi’s with: Mosquitto MQTT, Home Bridge, Home Assistant (for evaluation only)