06.08.2021, 08:14
(06.08.2021, 06:14)lasttrip Wrote: good morning, someone has a profile created to control the lighting of the pool with the control.
ASTRALPOOL LUMIPLUS MODBUS
Could you make it easier for me
Thanks
It's not possible to do this via a profile because multiple requests are needed for certain operations. You can use event scripts together with Modbus proxy. For it to work you need to enable RTU-1 and set correct serial port configuration in Modbus tab. Change slave ID in all scripts if needed (currently set to 1).
Color 1..12 (1 byte unsigned int)
Code:
value = event.getvalue()
value = math.min(value, 12)
value = math.max(value, 1)
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(1)
mb:writeregisters(0x25, value)
mb:writebits(0x213, true)
Sequence 1..8 (1 byte unsigned int)
Code:
value = event.getvalue()
value = math.min(value, 8)
value = math.max(value, 1)
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(1)
mb:writeregisters(0x26, value)
mb:writebits(0x214, true)
Speed 1..8 (1 byte unsigned int)
Code:
value = event.getvalue()
value = math.min(value, 8)
value = math.max(value, 1)
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(1)
mb:writeregisters(0x27, value)
mb:writebits(0x214, true)
On/Off (1 bit)
Code:
value = event.getvalue()
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(1)
coil = value and 0x210 or 0x211
mb:writebits(coil, true)