Hi, use a scheduled script that polls the data as often as needed
Code:
local zb = require('applibs.zigbee')
local ieee = 'f4ce36e12b9esa24'
local res, err = zb.cmdsync('getnamedattributes', ieee, 'HaElectricalMeasurement', {'RmsVoltage'})
log(res)
log(err)
if res then
local rmsVoltage = res.RmsVoltage
grp.checkwrite('37/1/3', rmsVoltage) -- 37/1/3 your group address
end
res, err = zb.cmdsync('getrawattribute', ieee, 0xFEE7, 0x0010)
log(res)
log(err)
local total_active_energy = res
if total_active_energy then
total_active_energy = total_active_energy / 1000 -- to get kWh
grp.checkwrite('37/1/4', total_active_energy) -- float value
end