31.08.2022, 12:38
Try replacing the parse function with this:
If it does not work then provide logs of the received messages.
Code:
function parse(msg)
local chunks = msg:split('*')
local who = table.remove(chunks, 1)
if who == '#1' then
local what, where = unpack(chunks)
parselighting(what, where)
elseif who == '#4' then
local where, dimension, value = unpack(chunks)
parsetemperature(where, value)
end
end