Getting:
Code: Select all
2017-07-18 20:41:00.241 dzVents: Info: ------ Start internal script: Start Workday:, trigger: at 20:41 on mon,tue,wed,thu,fri
2017-07-18 20:41:00.278 Error: dzVents: Error: Method switchOn is not available for device "Bedroom Right Side" (deviceType=Lighting 1, deviceSubTyp
e=ELRO AB400). If you believe this is not correct, please report.
2017-07-18 20:41:00.279 Error: dzVents: Error: An error occured when calling event handler Start Workday
2017-07-18 20:41:00.279 Error: dzVents: Error: ...ticz/scripts/dzVents/generated_scripts/Start Workday.lua:29: attempt to index a nil value
2017-07-18 20:41:00.279 dzVents: Info: ------ Finished Start Workday
Code: Select all
-- Sunrise, turn off all kinds of lights
return {
active = true, -- set to false to disable this script
on = {
timer = {
'at 20:41 on mon,tue,wed,thu,fri'
}
},
execute = function(domoticz)
local bedroom_left = domoticz.devices('Bedroom Left Side')
local bedroom_right = domoticz.devices('Bedroom Right Side')
local bedroom_blue_lamp = domoticz.devices('Bedroom Blue Lamp')
local tall_lamp = domoticz.devices('Staande Lamp')
local mirror_leds = domoticz.devices('Spiegel Leds')
local livingroom = domoticz.devices('Huiskamer')
if (not bedroom_left.bState) then
local RANDOM_DELAY_MINS = 15
bedroom_left.switchOn().withinMin(RANDOM_DELAY_MINS)
domoticz.notify('Hey!', 'Kitchen Left Light switched on!', domoticz.PRIORITY_NORMAL)
end
if (not bedroom_right.bState) then
local RANDOM_DELAY_MINS = 15
bedroom_right.switchOn().withinMin(RANDOM_DELAY_MINS)
domoticz.notify('Hey!', 'Kitchen Left Light switched on!', domoticz.PRIORITY_NORMAL)
end
if (not bedroom_blue_lamp.bState) then
local RANDOM_DELAY_MINS = 15
bedroom_blue_lamp.switchOn().withinMin(RANDOM_DELAY_MINS)
domoticz.notify('Hey!', 'Kitchen Left Light switched on!', domoticz.PRIORITY_NORMAL)
end
if (not tall_lamp.bState) then
local RANDOM_DELAY_MINS = 15
tall_lamp.switchOn().withinMin(RANDOM_DELAY_MINS)
domoticz.notify('Hey!', 'Kitchen Left Light switched on!', domoticz.PRIORITY_NORMAL)
end
if (not mirror_leds.bState) then
local RANDOM_DELAY_MINS = 15
mirror_leds.switchOn().withinMin(RANDOM_DELAY_MINS)
domoticz.notify('Hey!', 'Kitchen Left Light switched on!', domoticz.PRIORITY_NORMAL)
end
end
}
Regards, Jacco