The following show as “UNINSTALL” in the Paper UI Add-ons which implies they are installed.
MQTT Binding UNINSTALL
MQTT Action UNINSTALL
Json Path Transformation UNINSTALL
Yet the MQTT binding does not show in… Paper U I | Configuration | Bindings
Is this normal? Could this be my problem?
I can switch my Sonoff Basic module on and off witth the following command line
mosquitto_pub -t cmnd/sonoff-3/POWER -m ON
mosquitto_pub -t cmnd/sonoff-3/POWER -m OFF
Therefore the MQTT broker is working,
However the bindings does not work with this item
I defined HABbroker in services/mqtt.cfg
sonoff-3 is the topic name
I flashed sonoff-tasmota on the sonoff
my rule is…
rule "mqtt_gazebo_blink"
when
Time cron "0/5 * * ? * * *"
then
if (Gazebo_Lights.state == ON)
{ Gazebo_Lights.sendCommand(OFF) }
else { Gazebo_Lights.sendCommand(ON) }
end
The serial monitor is showing on and off every 5 seconds, so the rule seems to be working OK, but the Sonoff LED does not blink.
Yes it is normal, it is a legacy binding and will not show on the UI
The binding need to be configured by editing the mqtt.cfg file in your conf/services folder
You should see a configuration file mqtt.cfg among your service files ($OPENHAB_CONF/services/mqtt.cfg). In short the file has to contain the URL of your broker and login credentials (if available):
for broker.user I used a newly created MQTT user name “HABbroker” or should I have used my Rasberry Pi openHAB server user ID “openhabian”, like in the example?
For broker.pwd I created a different one than my openHAB server log in password.
Should MQTT broker log-in and openHAB server login (user and pwd) be different things??? Or may they be the same? Or must they be the same?
Wha’s with the (if available) statement? Seems like they are necessary
Ok… Let me try again. Here is my confusion:
Initially I came to the understanding that three entities EACH needed an IP, User ID, and Password.
The openHAB run time
The Mosquitto MQTT Broker … and
Each MQTT Client, (in my case sonoff-tasmota)
I have now come to the understanding that the sonoff-tasmota does NOT need a User ID, and Password. But only an IP address assigned by my rounter’s DHCP. Is this correct ???
Now what is still not clear, is… Must the openHAB runtime and Mosquitto MQTT Broker have the same identical … User ID and Password???
I made mine different although they are both hosted on the same Rasberry PI. I called them HABbroker and HABuser with a unique password, in the … services/mqtt.cfg file. Should I have used openhabian or openhabianpi or an IP address instead of HABbroker???
Furthermore I only configured … the …/services/mqtt.cfg file which is a openHAB Binding file. Should I somehow have configured the actual Mosquitto MQTT Broker application. This may be my problem… I don’t recall configuring the actual Mosquitto MQTT broker application… I just did the Binding’s mqtt.cfg. file
The mqtt broker is like a courier delivery service
The tasmota and OH are customers
The tasmota and OH can both send and receive messages BUT they need to know the address of the broker and if set up a username and password. They also need an individual clientId so that the broker knows which is which.
Clear?
Please answer all these questions one by one
On what computer is the mqtt broker installed?
What is that computer ip address?
Does your tasmota connect to mqtt?
If your tasmota connects to your broker, then enter EXACTLY the SAME mqtt settings in the OH mqtt.cfg. EXCEPT the clientID. Leave that commented OUT, it will get a unique ID on it’s owns. Don’t complicate things.
2018-05-24 02:06:34.309 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'habbroker'
==> /var/log/openhab2/events.log <==
2018-05-24 02:06:41.461 [ome.event.ItemCommandEvent] - Item 'Gazebo_Lights' received command ON
2018-05-24 02:06:41.470 [vent.ItemStateChangedEvent] - Gazebo_Lights changed from NULL to ON
2018-05-24 02:06:45.032 [ome.event.ItemCommandEvent] - Item 'Gazebo_Lights' received command OFF
2018-05-24 02:06:45.039 [vent.ItemStateChangedEvent] - Gazebo_Lights changed from ON to OFF
2018-05-24 02:06:50.020 [ome.event.ItemCommandEvent] - Item 'Gazebo_Lights' received command ON
2018-05-24 02:06:50.035 [vent.ItemStateChangedEvent] - Gazebo_Lights changed from OFF to ON
2018-05-24 02:06:55.021 [ome.event.ItemCommandEvent] - Item 'Gazebo_Lights' received command OFF
Looks like MQTT started. The 5 second ON and OFF rule running shows that my rule is working. I just can’t seem to get my item to work that actually connands the sonoff