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.
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