Assistance with exec binding in openhab 3

Hi guys,

I’m still running openhab 1.9. The last couple of years I didn’t spend much time on my domotics. But I feel it’s time to take a giant leap forward.

My old openhab setup controls several programmable relays (Zelio Schneider). About ten year ago’s someone provided me some C-programs which are able to read from and write to these relays. To do this I use the exec binding.

Basically 90 percent of my home is controlled with items like this:

Switch Light_Kitchen “Kitchen Light” (GF_Kitchen, Lights)
{ exec="
<[/home/scripts/ison ttyUSB0 10:1000:REGEX((.*?))]
>[OFF:/home/scripts/setstate ttyUSB0 10 0]
>[ON:/home/scripts/setstate ttyUSB0 10 1]
" }

Thus the first ‘ison’ command reads the state every second. I am not sure what the added value is from the REGEX in this one.
And the ‘setstate’ commands enable to switch lights on and off.

Today I just started with openhab3 … but I don’t have a clue how to integrate these commands. Can someone show me the way? Some examples of similar setups (switches managed via exec commands) might be useful.

Thanks already

Bert

The exec v-1 required a transformation of some kind, that one is a no-op.

Start with something simpler,like Astro or Weather, to familiarise with Things, channels, and their links to Items.
Then have a look at Exec binding docs.
Because your “ins” and “outs” are completely different, you might set up a read-only Thing to poll for device status.
When that’s working, you might set up another Thing to pass out ON/OFF commands. You can link more than one channel to the same Item.