(Yesterday, 06:18)Daniel Wrote: It works with any imx6 version of LM
Ok, but I can't get the script to work. Are we supposed to add a user library for this?
Update: I always get the error message: "address must be a string or a number".
Here is my script:
Code:
local zb = require('applibs.zigbee')
local ieee = 'f4ce36e12b9esa24'
local cluster = 0x0B04
local endpoint = 10
local args = {
ieee = ieee,
endpoint = endpoint,
cluster = cluster,
attributes = { 'rmsvoltage' }
}
local res, err = zb.cmdsync('getnamedattributes', args)
if type(res) == 'table' then
log('Zigbee-respons: ' .. json.encode(res))
if res.rmsvoltage then
log('Spenning (RMS): ' .. tostring(res.rmsvoltage) .. ' V')
else
log('Ingen rmsvoltage funnet i respons')
end
else
log('Feil ved lesing: ' .. tostring(err or 'ingen respons'))
end