I have Blinds (RFXtrx433XL - Type DC106) at the second floor which doesn't have an autostop function.
So if the window is open and the Blind command is "Close" it may get broken.
Now I also have a "Door Contact" (Zigbee2mqtt) device which I have attached to the window behind the Blinds.
Is it possible with dzVents to only open or close the Blinds if the "Door Contact" is closed?
Or "Stop" the Blinds (and if possible go back to "Open") when the "Door Contact" is set to "Open"?
I tried with following script but nothing happens when I first "Open" the "Door Contact" and "Close" the "Blinds" (not attached yet to the window ofcourse):
Code: Select all
--- Rolluik security dzVents script
return
{
on =
{
devices =
{
'Raam Sensor',
},
},
logging =
{
level = domoticz.LOG_ERROR,
marker = 'Rolluik Security Raam Sensor',
},
execute = function(dz, item)
local luik = dz.devices('Luik 1')
dz.log(luik.name .. ' (' .. luik.baseType ..') State is ' .. luik.state ,dz.LOG_DEBUG )
dz.log(item.name .. ' (' .. item.baseType ..') State is ' .. item.state ,dz.LOG_DEBUG )
if item.isDevice and item.state == 'Open' and luik.state == 'Close' then
luik.cancelQueuedCommands()
luik.Stop().checkFirst()
luik.Open().checkFirst()afterSec(1)
end
end
}
Code: Select all
2021-05-20 21:02:04.827 RFXtrx433XL: Blinds (Luik 1)
2021-05-20 21:02:07.674 Status: dzVents: Info: Handling events for: "Raam Sensor", value: "Open"
2021-05-20 21:02:10.818 Status: dzVents: Info: Handling events for: "Raam Sensor", value: "Closed"
2021-05-20 21:02:12.939 RFXtrx433XL: Blinds (Luik 1)
2021-05-20 21:02:27.552 Status: dzVents: Info: Handling events for: "Raam Sensor", value: "Open"
2021-05-20 21:02:33.831 RFXtrx433XL: Blinds (Luik 1)
2021-05-20 21:02:35.031 RFXtrx433XL: Blinds (Luik 1)
2021-05-20 21:02:42.230 Status: dzVents: Info: Handling events for: "Raam Sensor", value: "Closed"