This is what I have now :
Code: Select all
--------------------------------
------ Variables to edit ------
--------------------------------
devicename = "Lux meter" --Name of the device
debug = true
--------------------------------
-- End of variables to edit --
--------------------------------
commandArray = {}
if (devicechanged[devicename]) then
if (debug) then
print("Following values are coming in from device: ")
for i, v in pairs(devicechanged) do print(i, v) end
end
-- how can I read the lux value from the sensor ?
commandArray['Variable:LUX']='1234' -- fixed value for now, this should be the current lux
end
return commandArray
Code: Select all
2016-08-20 10:49:15.004 LUA: Following values are coming in from device:
2016-08-20 10:49:15.004 LUA: Lux meter_Utility
2016-08-20 10:49:15.004 LUA: 508
2016-08-20 10:49:15.004 LUA: Lux meter
2016-08-20 10:49:15.004 LUA:
2016-08-20 10:49:15.006 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_Lux meter.lua
Thanks !