[SOLVED] DzVents door.state is always open?
Posted: Wednesday 02 August 2017 14:24
Domoticzversion: 3.8152
Platform: RPi 3
A problem which drives me crazy and probably some stupid mistake of myself I overlook.
I have a doorsensor, which switches in Domoticz just fine. It shows the open and closed state.
In DzVents I want to check the state and send a notification when the door is open. Just a standard script.
But the state doesn't change. It is always open. Anyone knows why this could occur?

Platform: RPi 3
A problem which drives me crazy and probably some stupid mistake of myself I overlook.
I have a doorsensor, which switches in Domoticz just fine. It shows the open and closed state.
In DzVents I want to check the state and send a notification when the door is open. Just a standard script.
But the state doesn't change. It is always open. Anyone knows why this could occur?
Code: Select all
--[[
Send a warning when the garage door has been open for more than 10 minutes
]]
return {
active = true,
on = {
devices = {
'Select'
},
timer = {
'every minute'
}
},
execute = function(domoticz)
local door = domoticz.devices('Achterdeur')
domoticz.log('Deurscript')
domoticz.log(door.state)
--if (door.state == 'Open' and door.lastUpdate.minutesAgo > 10) then
-- domoticz.log('Deur is open 5 seconden')
-- domoticz.notify('Garage door alert',
-- 'The garage door has been open for more than 10 minutes!',
-- domoticz.PRIORITY_HIGH)
--end
end
}
Code: Select all
2017-08-02 14:20:00.468 dzVents: Info: ------ Start internal script: DoorCheck:, trigger: every minute
2017-08-02 14:20:00.485 dzVents: Info: Deurscript
2017-08-02 14:20:00.485 dzVents: Info: Open
2017-08-02 14:20:00.485 dzVents: Info: ------ Finished DoorCheck
