14.10.2022, 06:17
Use this (1/1/1 is battery object, 1/1/2 is target temperature value object):
Code:
mqtt_to_object = {
['shellies/shellytrv-14B457E5C2C8/info'] = '1/1/1',
}
mqtt_to_object_conv = {
['shellies/shellytrv-14B457E5C2C8/info'] = function(payload)
local data = require('json').pdecode(payload)
if type(data) == 'table' then
grp.write('1/1/2', data.target_t.value)
return data.bat
end
end
}