How can I talk to a tcp socket for a simple json request/response using openhab 3.
I have a homegrown internal IOT setup that I have put together over the years from devices like RS232 serial connected Microchip 1684 to ethernet arduino nano to wifi wemos boards. I have alway done straight request/response devices so all my devices are controlled by a simple C program but can be controlled via any programming language due to the simple json request/response interface. eg: via shell:
I am on an expansion plan now so to try and make my life easier I have installed openhab 3 on a RPI3 B+. I have configured a basic setup using the UI with a dummy thing using the mqtt_binding that I can control with the mosquito_[sub|pub] CLI commands but now I am stuck on how to talk to all my existing devices. Is there a basic tcp request/response binding that I missed or some other binding that would be appropriate.
I know I can reflash some devices with more generic code like tasmota but this isnt a solution to all.
Ok, I now have a simple script that does the following:
/usr/local/bin/sdevice ON
ON
/usr/local/bin/sdevice STAT
ON
/usr/local/bin/sdevice OFF
OFF
As I have no openhab2 experience so I am trying to use the UI to configure my exec bindings but have failed dismally. I created 2 things using the exec binding using the following:
Label Device On
Command /usr/local/bin/sdevice ON
Transform REGEX((.*))
Interval 0
Timeout 15
Autorun off
and another…
Label Device On
Command /usr/local/bin/sdevice OFF
Transform REGEX((.*))
Interval 0
Timeout 15
Autorun off
I have set up the misc/exec.whitelist as defined in doco. I dont think I need any channels…
I am now trying to work out what to do for the items to make my script work as a switch but nothing I try runs the script and no events in the log.