BryanLee
(Bryan Lee Ragon)
December 27, 2018, 1:02pm
1
Openhabian installation. Trying to get OpenHab 2.4 working with mosquitto and some Tasmota Sonoff devices.
Mosquitto and the Sonoffs are working just fine. I can subscribe to their topics, see state changes and publish topics that switch the lights.
I have installed the MQTT binding through Paper UI.
I have edited my mqtt.cfg file:
pid:org.openhab.mqtt
mqtt.qos=1
mqtt.retain=true
mqtt.async=false
mqtt.url=tcp://127.0.0.1:1883
mqtt.clientId=oh2
mqtt.user=openhabian
mqtt.pwd=ObligatoryPwd
And my mqtt.cfg items file:
Switch sonoff_attic_light "Attic Lights" { mqtt="<[mqtt:stat/sonoff-light-attic/POWER:state:default], >[mqtt:cmnd/sonoff-light-attic/POWER:command:ON:on], >[mqtt:cmnd/sonoff-light-attic/POWER:command:OFF:off]" }
In the console:
>config:edit org.openhab.mqtt
>config:property-list
mqtt.async = false
mqtt.clientId = oh2
mqtt.pwd = ObligatoryPwd
mqtt.qos = 1
mqtt.retain = true
mqtt.url = tcp://127.0.0.1:1883
mqtt.user = openhabian
Log:
2018-12-27 07:52:45.570 [WARN ] [g.dispatch.internal.ConfigDispatcher] - The file /etc/openhab2/services/mqtt.cfg subsequently defines the exclusive PID 'org.openhab.mqtt'. Overriding existing configuration now.
2018-12-27 07:53:08.858 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'
2018-12-27 07:53:08.887 [ome.event.ItemUpdatedEvent] - Item 'sonoff_attic_light' has been updated.
So it appears that it is not even trying to connect to the broker. Any ideas?
vzorglub
(Vincent Regaud)
December 27, 2018, 1:06pm
2
Which MQTT binding did you install? v1 or v2?
1 Like
vzorglub
(Vincent Regaud)
December 27, 2018, 1:08pm
3
If you are using v2, see:
Hi guys,
after hours of working on my openHAB2 configuration for my Sonoff Smart Switches, using the Tasmota firmware, I got that running, using the new MQTT2 binding. As for now I have 7 Sonoff Power Switches and didn’t want to configure them through PaperUI. After a hint from @Dim I got my configuration completely in files, providing me with the ability to do some slight changes on all channels at the same time.
This is just meant as an example and I would be more than happy, get more hints …
If you are using v1 see:
ITEAD Smart Home Products
https://www.itead.cc/wiki/Sonoff_Smart_Home_Solution
[image][image][image]
These very cheap modules come with their special smartphone app but are all actually based on the famous ESP8266. It didn’t take long till the tinkerer community got a hold of that and started hacking. After opening up the cases, all you need to do is solder a few header pins and connect your FTDI breakout programmer. Alternative firmwares are ready to provide nice MQTT based Wifi SmartHome end…
1 Like
BryanLee
(Bryan Lee Ragon)
December 27, 2018, 1:21pm
4
Paper UI → Add Ons → Bindings → MQTT (binding-mqtt - 2.4.0)
I will double check the MQTT2 binding Tutorial you listed, thank you!
BryanLee
(Bryan Lee Ragon)
December 28, 2018, 2:18am
5
Yeah, I was definitely confused. Still doing my initial setup and didn’t realize the MQTT binding underwent a major upgrade during that time. Still fighting to get it working, but I’ll leave this thread as is and start a new one if I need to.