rossko57
(Rossko57)
June 16, 2021, 11:37am
3
Platform information:
Hardware: CPUArchitecture/RAM/storage i5/16GB/256GB
OS: _what OS is used and which version_Ubuntu 20.04
Java Runtime Environment: _which java platform is used and what version_openJDK 11
openHAB version:3.0.0
Issue of the topic: Ligth switch that needs to publish a json string at on or off
So I have a Zigbee Blizwolf plugg, a Tasmota 9.2 Coordinator and what to control this by MQTT.
On the “on” action I need to publish a command and a jason string.
so basacly to publ…
If you must publish from a rule (for example, you want to publish JSON based on the state of two different Items), then use the MQTT Action instead of exec.
Hi,
I did it with
var mqttActions = Actions.getActions("mqtt","mqtt:broker:yourBrokerID"); mqttActions.publishMQTT("yourtopic", "hurray!")
Another solution, I found is:
actions.get("mqtt", "mqtt:broker:yourBrokerID").publishMQTT("yourtopic", "hurray!")
1 Like