Might need a bit of help with mqtt with this one.
I have mosquitto running on two devices as follows:
192.168.1.106 hosting OH2 (openhabian) and localbrokerrb
192.168.1.103 hosting node-red running 24/7
I send mqtt messages from a couple of Sonoff devices (and some others but not relevant) and want to exchange messages with both of the above.
I want to use a rule in OH to send an mqtt command. At the command line on the OH machine this works fine: mosquitto_pub -h 192.168.1.103 -t cmnd/sonoff2/POWER -m 1
But have not been able to get the rule to send the message.
The item line looks like:
Switch WT_Waterpump "Water Pump" { mqtt=">[192.168.1.103:cmnd/sonoff2/POWER:command:*:default],<[192.168.1.103:stat/sonoff2/POWER:state:default]" }
and the rule :
when
Time cron "0 29 16 * * ?"
then
sendCommand(WT_Waterpump, ON)
postUpdate(WT_Waterpump, ON)
end
But no action results at the Sonoff. After reading the man for mosquitto I have added the two addresses to the .conf file this : address 192.168.1.106:1883 192.168.1.103:1883
This also does not give me the result.
Any tips on how I can work with mosquitto on two devices?