Blame | Last modification | View Log | Download
-- local device id's, only used in this scriptlocal cDevST630Alarm = 210 --ST630 hallocal cDevVirtAlert = 211return {on = {devices = {cDevST630Alarm},system = {'start'},-- timer = { 'every 1 minutes' },},logging = {--level = domoticz.LOG_DEBUG + domoticz.LOG_INFO,level = domoticz.LOG_ERROR,marker = 'ST630-Bijkeuken',},execute = function(domoticz, triggeredItem)if (triggeredItem.isDevice) thendomoticz.log('Device ' .. triggeredItem.name .. ' was changed', domoticz.LOG_INFO) --domoticz.LOG_FORCEend-- Mark defaulr alert level as normalAlertLevel = 1if (triggeredItem.isSystemEvent) thendomoticz.log('System event handling', domoticz.LOG_DEBUG)if (triggeredItem.type == 'start') thendomoticz.devices(cDevVirtAlert).updateAlertSensor(0, 'not yet queried..')endenddomoticz.log('Device ' .. domoticz.devices(cDevST630Alarm).name .. ' has value: ' .. tostring(domoticz.devices(cDevST630Alarm).nValue), domoticz.LOG_INFO) --domoticz.LOG_FORCE-- set the alarm level/text on the virtual device-- ALERTLEVEL_GREY, ALERTLEVEL_GREEN, ALERTLEVEL_YELLOW, ALERTLEVEL_ORANGE, ALERTLEVEL_REDif (domoticz.devices(cDevST630Alarm).nValue ~= 0) thenAlertLevel = 4enddomoticz.devices(cDevVirtAlert).updateAlertSensor(AlertLevel, domoticz.devices(cDevST630Alarm).state)end}