But although I do see that the time changes on the button as 'last seen' I do not see this in the log of the dummy device. I do not understand why this is happening. The switch never goes to On state as it should.
This is the script I use:
Code: Select all
return
{
on =
{
devices =
{
'MS Keuken Beweging',
'MS Hal Beweging',
'MS Achterhuis Beweging',
'MS Voorhuis Beweging',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
},
execute = function(dz)
local motionkeuken = dz.devices('MS Keuken Beweging').state
local motionhal = dz.devices('MS Hal Beweging').state
local motionachterhuis = dz.devices('MS Achterhuis Beweging').state
local motionvoorhuis = dz.devices('MS Voorhuis Beweging').state
local motionbg = dz.devices('Beweging begane grond')
dz.log('State of MS Beweging Keuken ' .. tostring(motionkeuken), dz.LOG_DEBUG)
dz.log('State of MS Beweging Hal ' .. tostring(motionhal), dz.LOG_DEBUG)
dz.log('State of MS Beweging Achterhuis ' .. tostring(motionachterhuis), dz.LOG_DEBUG)
dz.log('State of MS Beweging Voorhuis ' .. tostring(motionvoorhuis), dz.LOG_DEBUG)
dz.log('State of Bewegingsdetectie begane grond ' .. tostring(motionbg), dz.LOG_DEBUG)
if motionkeuken == 'On' or motionhal == 'On' or motionachterhuis == 'On' or motionvoorhuis == 'On' then
motionbg.switchOn().forMin(1)
elseif motionkeuken == 'Off' and motionhal == 'Off' and motionachterhuis == 'Off' and motionvoorhuis == 'Off' then
motionbg.switchOff() --.afterMin(1)
end
end
} Code: Select all
2020-06-11 17:47:18.786 Status: dzVents: Info: Handling events for: "MS Achterhuis Beweging", value: "Off"
2020-06-11 17:47:18.786 Status: dzVents: Info: ------ Start internal script: Bewegingsdetectie Begane Grond DzVents: Device: "MS Achterhuis Beweging (OpenZwave)", Index: 219
2020-06-11 17:47:18.788 Status: dzVents: Debug: Processing device-adapter for MS Keuken Beweging: Switch device adapter
2020-06-11 17:47:18.791 Status: dzVents: Debug: Processing device-adapter for MS Hal Beweging: Switch device adapter
2020-06-11 17:47:18.794 Status: dzVents: Debug: Processing device-adapter for MS Voorhuis Beweging: Switch device adapter
2020-06-11 17:47:18.797 Status: dzVents: Debug: Processing device-adapter for Beweging begane grond: Switch device adapter
2020-06-11 17:47:18.797 Status: dzVents: Debug: State of MS Beweging Keuken Off
2020-06-11 17:47:18.797 Status: dzVents: Debug: State of MS Beweging Hal Off
2020-06-11 17:47:18.798 Status: dzVents: Debug: State of MS Beweging Achterhuis Off
2020-06-11 17:47:18.798 Status: dzVents: Debug: State of MS Beweging Voorhuis Off
2020-06-11 17:47:18.798 Status: dzVents: Debug: State of Bewegingsdetectie begane grond table: 0x6eee7018
2020-06-11 17:47:18.798 Status: dzVents: Debug: Constructed timed-command: Off
2020-06-11 17:47:18.798 Status: dzVents: Info: ------ Finished Bewegingsdetectie Begane Grond DzVents
2020-06-11 17:47:18.801 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua 


