I have been trying to get Openhab to control a serial device. To control from both a button and time rule. I have not had any success yet. I’ve scowered the forums and documentation, there isn’t any thing definitive. There are bits and pieces but not everything I need to make it work.
So far I have a RS232 Insteon modem working on one port, and the Zwave/Zigbee dongle running which is via it’s usb to serial chip.
I’m using a 4 port USB to Serial device on a Raspberry Pi 3. So far it’s working with the Insteon modem on /dev/ttyUSB1
The Serial device I’m trying to control is in /dev/ttyUSB4 I can use Minicom with it just fine. Just for reference it is one of the old circuit cellar/micromint DIO boards with RS485.
I have the serial binding installed.
What I need to do is:
-How to correctly Add the device to Openhab, well set it up so I can define the actual serial strings
-How to correctly define buttons that actually work with it.
-What needs to be created in Items, Things, Sitemaps, Rules or Services.
How it needs to be controlled:
Via some sort of button in the various Openhab UI’s. It could be individual switches for the zones… but bit #8 is the pump control, but the pump must never run without one of the zones if that makes sense…
Send these commands to the sprinkler control:
! DIO0 S DP=7E and a CRLF for Zone 1
! DIO0 S DP=7D and a CRLF for Zone 2
! DIO0 S DP=7B and a CRLF for Zone 3
! DIO0 S DP=77 and a CRLF for Zone 4
! DIO0 S DP=6F and a CRLF for Zone 5
! DIO0 S DP=5F and a CRLF for Zone 6
! DIO0 S DP=3F and a CRLF for Zone 7
! DIO0 S DP=FF and a CRLF for OFF
The ultimate desire would be able to control the individual bits that make up the hex value above lines. As well as have Openhab querry the DIO device for status. That command looks like
! DIO0 Q DP and a CRLF
Generally speaking I’ve always preceded the commands to these with a CRLF and then one following the command to have the device process the command. This is a RS485 line, so it’s half duplex, so we can’t send and receive at the same time.
I’ve not found any of the documents or other posts complete enough to get this to work. Usually it’s maybe sending the commands, but I’ve seen things in both the items file and rules, but not linking all the way to the UI so I’m not sure which is the right way on this. This would apply to alot of serial devices just just this particular serial control device…
I appreciate any help on this!