i started using dzvents and it is really nice once you get the logic in your head, i created a script which would turn on my bathroom lights (Group badkamer boven = the name in the script) when my motion sensor(PIR badkamer boven = the name in the script) is triggered or when there is water in the shower(Water douche boven = the name in the script). it works well but i had something in my blockly which i was using before where i could check the lux value of my motionsensor and act upon it, also i had time values for example before 23:00 set light to 100% after 23:00 set light at 40% but only if the shower is off. and this all if the lux value was below 30
while i think dzvents would be a much better solution then my 4 combined blockly scripts which stopped magically working i can not seem to find out from the documentation or the awesome getting started video how to get the above functions in my script. so if someone can help me, please... also, do not laugh at my basic level of dzvents plz XD
Code: Select all
return {
on = {
devices = {
'Water douche boven',
'PIR badkamer boven',
'licht tk was aan'
}
},
execute = function(domoticz, device)
if(device.state == 'On') then
local badkamer = domoticz.devices('Group badkamer boven').dimTo(100)
badkamer.switchOn()
else
local badkamer = domoticz.devices('Group badkamer boven')
badkamer.switchOff()
end
end
}