Code: Select all
if (item.isDevice) and ((User1Thuis.state == 'Off') and (User2Thuis.state == 'Off') and VakantieSchema.state == 'Off') then
dz.log('User1 and User2 not at home, turning on holiday lighting schedule', dz.LOG_DEBUG)
pushover(PushoverUsers.User1, PushoverApps.Huis, 'Vakantie Verlichting', 'User1 and User2 not at home. \nTurning on holiday lighting schedule', 0, 'none' )
VakantieSchema.switchOn()
elseif (item.isDevice) and ((User1Thuis.state == 'On') or (User2Thuis.state == 'On') and VakantieSchema.state == 'On') then
VakantieSchema.switchOff()
dz.log('User1 and User2 at home, turning off holiday lighting schedule', dz.LOG_DEBUG)
if (User1Thuis.state == 'On') and (User2Thuis.state == 'Off') then
pushover(PushoverUsers.User1, PushoverApps.Huis, 'Vakantie Verlichting', 'User1 is home. \nTurning off holiday lighting schedule', 0, 'none' )
elseif (User2Thuis == 'On') and (User1Thuis.state == 'Off') then
pushover(PushoverUsers.User1, PushoverApps.Huis, 'Vakantie Verlichting', 'User2 is home. \nTurning off holiday lighting schedule', 0, 'none' )
elseif (User1Thuis.state == 'On') and (User2Thuis.state == 'On') then
pushover(PushoverUsers.User1, PushoverApps.Huis, 'Vakantie Verlichting', 'User1 and User2 are home. \nTurning off holiday lighting schedule', 0, 'none' )
end
end
"if (User1Thuis.state == 'On') and (User2Thuis.state == 'Off') then"
would only be executed if the main
"elseif (item.isDevice) and ((User1Thuis.state == 'On') or (User2Thuis.state == 'On') and VakantieSchema.state == 'On') then" block is true.
That is not the case and it will trigger the pushover notification.\
Am I missing something?