first script to control lamps when im watching TV
Posted: Saturday 05 August 2017 10:05
Hi guys
this is my first script to control a set of milights in my lounge room when diffrent actions occur on the TV
i get an error about expected actions on line 35
im really no programer at all.....
anyone alble to just highlight what i need to change?
any improvement suggestions are appriciated
this is my first script to control a set of milights in my lounge room when diffrent actions occur on the TV
i get an error about expected actions on line 35
im really no programer at all.....
anyone alble to just highlight what i need to change?
any improvement suggestions are appriciated
Code: Select all
-- Check the wiki at
-- http://www.domoticz.com/wiki/%27dzVents%27:_next_generation_LUA_scripting
return {
-- 'active' controls if this entire script is considered or not
active = true, -- set to false to disable this script
-- trigger
-- can be a combination:
on = {
devices = {
-- scripts is executed if the device that was updated matches with one of these triggers
'Lounge Kodi', -- kodi media centre in Lounge
},
timer = {
'at nighttime',
},
},
-- actual event code
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
--[[
The domoticz object holds all information about your Domoticz system. E.g.:
local myDevice = domoticz.devices('myDevice')
local myVariable = domoticz.variables('myUserVariable')
local myGroup = domoticz.groups('myGroup')
local myScene = domoticz.sceneds('myScene')
The device object is the device that was triggered due to the device in the 'on' section above.
]] --
-- example
if ('Lounge Kodi'.state == 'Video') then
domoticz.setScene('TV Playing', 'On')
domoticz.notify('Lounge kodi', 'mood lights on')
elseif ('Lounge Kodi'.state == 'Paused') or (device.state == 'on') then
domoticz.setScene('Lounge Normal Lights', 'On')
domoticz.notify('Lounge kodi', 'mood lights on')
end
end
},