Hi, I know that is a bit off topic, but I have this strange config where I have a remote (still in the same network segment) system (RPI) running a python script to query some nonstandard hardware that does not have a binding.
Reporting of the values to my main OH is done by MQTT and that works great.
But I now need to send a command to this remote system from the OH (a simple 0/1) switch. And I wonder what is the easy way to do that? Any suggestions?
Send an MQTT command message. Here is an example where I have a seperate RPI running with zigbee2mqtt, OH can both receive and send messages to control the light.
Ok, great, thanks for the example syntax, revealing is that you can receive and send the command on the same Item. That helps a lot.
Do you have some code example how to receive mqtt on the remote system in python?
I’ve posted a Python script I use for this sort of thing that has kind of taken off well beyond it’s original intended purpose. https://github.com/rkoshak/sensorReporter
It implements the two way MQTT for you and supports plug-ins.