Code: Select all
return {
on = {
"CPU"
},
active = true,
execute = function(domoticz, sensor)
-- print(sensor.name .. " triggered")
print(' CPU triggered')
end
}
Code: Select all
2016-03-07 16:58:44.479 LUA: Handling events for: "CPU", value: ""
2016-03-07 16:58:44.479 LUA: =====================================================
2016-03-07 16:58:44.480 LUA: >>> Handler: test
2016-03-07 16:58:44.480 LUA: >>> Device: CPU
2016-03-07 16:58:44.480 Error: EventSystem: /home/pi/domoticz/scripts/lua/event_helpers.lua:10: bad argument #1 to 'format' (number expected, got nil)
2016-03-07 16:58:54.832 (RFXCOM) Temp (envKitchen)
2016-03-07 16:58:55.393 (RFXCOM) Humidity (envKitchen)
2016-03-07 16:59:00.134 LUA: Phones: Peter's phone found 1h 32m ago
2016-03-07 16:59:00.135 LUA: Phones: Rita's phone lost 0h 0m ago
Code: Select all
for eventIdx, eventHandler in pairs(events) do
print('=====================================================')
print('>>> Handler: ' .. eventHandler.name )
if (device) then
printf('>>> Device: %s', device.name)
printf('>>> Index : %d', device.id)
end
Regards