I have a cheap relays module with ModBus support integrated. I`ve tested it with my debug scripts and it works well. Here is my short manual about it: link (russian lang). Relays on this card could not be accessed as coils and another scheme used instead.
For example if i need to enable relay number 2 i should write value 0x0200 to holding register 2, and i should write 0x0100 if it need to be changed back to open state.
My question is: how to use such kind of control scheme as reular Switch item if it is possible? I have a led lamp connected to such board and i need to enable and disable it with some schedule or manually.
Seems i not enough experienced yet (in OH configuration mostly) to understand how to bind different modbus commands (and may be check its state) for Switch item. Ive trying to build vegitables micro-farm in own room and this relay module should be used for activation/deactivation of light and water pump. It was mounted before i`ve found OH.
This line will write to holding register 2 (with index 1 in my modbus definition) on device slave2 numerical values 256 (0x0100) to switch relay to Closed state and 512 (0x0200) backwise as described in device documentation.
Note, that you should upgrade modbus binding in order to enable transformation functionality.
I have the same relay board. I want to controll my roller shutter with it. In my Installation I would like to have 2 relays to control 1 roller shutter. So one is for up and one for down. So I could define 2 relays like that: