Hello,
due to dynamic energy prices I wan't to enable / disable throttle of the inverter. This is possbile via modbus. Unfortunatelly it's not working and I have nothing in the log of LM.
Log if value <35
* arg: 1
* nil
* arg: 2
* string: <
=> This seems to work
Log if value >35
Nothing in the log and I don't know why.
Any idea what could be wrong?
due to dynamic energy prices I wan't to enable / disable throttle of the inverter. This is possbile via modbus. Unfortunatelly it's not working and I have nothing in the log of LM.
Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.1.111', 502)
mb:connect()
res, err = mb:connect()
if res then
if (value <35) then
r0 = mb:writeregisters(40236, 0)
log(r0, '<')
else
r1 = mb:writeregisters(40236, 0)
r2 = mb:writeregisters(40232, 10000)
r3 = mb:writeregisters(40236, 1)
log(r1, r2, r3 '>')
mb:close()
end
else
log('failed', err)
end
Log if value <35
* arg: 1
* nil
* arg: 2
* string: <
=> This seems to work
Log if value >35
Nothing in the log and I don't know why.
Any idea what could be wrong?