05.10.2021, 07:00
Use this as a starting point. response variable should contain your HTTP request result.
Code:
status = require('json').pdecode(response)
if type(status) == 'table' then
poweron = status.power ~= 'standby'
grp.checkupdate('1/1/1', poweron) -- power status (1 bit)
grp.checkupdate('1/1/2', status.input_text) -- input (text)
volume = status.volume / status.max_volume * 100
grp.checkupdate('1/1/3', volume) -- current volume (1 byte scale)
end