29.11.2022, 10:49
(29.11.2022, 10:35)admin Wrote: Add logging to the query function like this and post what you get in Logs tab:Lutron Status 29.11.2022 16:17:17
Code:function query(req, out)
if not sock then
return
end
sock:send(req .. '\r\n')
local res, err = sock:receive()
if not res then
return close(err)
end
if res:sub(1, 1) ~= '~' then
return close('invalid reply ' .. res)
end
if res:sub(2, #req) ~= req:sub(2) then
return close('invalid reply ' .. res)
end
local val = res:sub(#req + 2)
log('response', req, out, val)
val = tonumber(val)
if val then
grp.checkupdate(out, val)
end
end
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply QNET> ~OUTPUT,151,1,11.00
Lutron Status 29.11.2022 16:17:17
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply NET>
Lutron Status 29.11.2022 16:17:17
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply NET>
Lutron Status 29.11.2022 16:17:18
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply QNET> ~OUTPUT,151,1,11.00
Lutron Status 29.11.2022 16:17:18
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply QNET> ~OUTPUT,151,1,11.00
Lutron Status 29.11.2022 16:17:18
* arg: 1
* string: no connection to device
* arg: 2
* nil
Lutron Status 29.11.2022 16:17:23
* arg: 1
* string: receive failed
* arg: 2
* string: invalid reply QNET> ~OUTPUT,151,1,11.00