I am trying to switch on and off my AirCon through MQTT broadling bridge.
I set the ON and OFF actions on the the bridge and its work while I press play on the bridge
But when I try to through openhab rules, it’s not working.
I am using MQTT1 and mosquitto as the broker, all run on resp3
Yes, MQTT Action is installed.
Yes, Test3 is changing to exactly 8.0 and it is in use and work well to trigger other actions.
here is the events log:
2019-10-09 00:23:48.103 [vent.ItemStateChangedEvent] - ZWaveNode003ZRC90SceneMaster8ButtonRemote_SceneNumber changed from 7.0 to 8.0
2019-10-09 00:23:48.113 [vent.ItemStateChangedEvent] - Test3 changed from 7.0 to 8.0
I removed the item and add logging into the rule.
The rule is running every time change to 8.0 is happen but yet not action on the broadlink
rule "AirCon_ON"
when
Item Test3 changed to 8.0
then
logInfo("AirCon_ON","Rule running")
val topic = "broadlink/AirCon/OFF"
publish("mosquitto", topic, "play-780f77180d57")
end
To be successfull with any technology integration with OH, you must have at least a basic understanding of that technology. Please go read https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt/ to get a basic understanding of how MQTT works in general. You should get the answer to your question there.
Though it’s worth noting that I mentioned two examples of MQTT clients in my previous replies.
OK. I check the MQTT client log and nothing publish there.
While I directly trigger from the client it works and run.
SO I guess the action on the rule not reach the client, what can be the reason?
Check your mqtt.cfg file. Make sure you have both the MQTT Binding and MQTT Action installed. Put the binding in debug mode and see if there is anything interesting there.
This is pretty much the end of my ability to help with the MQTT 1.x binding. If you upgrade to the 2.x binding I can provide more help.
Thanks.
Is the MQTT2.x support broadlink? I choose 1.x just because I need to bridge with broadlink and read somewhere that 2.x not support it. I sit right?
MQTT is MQTT. It’s not specifically tied to any technology. All broadlink defines is the names of the topics and the contents of the messages which are all configuration parameters. The messages and topics you are using are perfectly supportable with the MQTT 2 binding.