My MQTT Binding is not working
I have problems to get my mqtt binding working.
installed:
MQTT binding is installed,
clean install with the openhab2 image for raspi ==> I used a raspi 3 b +
installed mosquitto => config anonymous connection allowed => on port 1
install mqtt binding in openhab (nothing else)
configured services/mqtt.conf
create item and sitemap i listed below
tested the mosquitto mqtt broker with manual command it is working perfectly
mqtt.cfg
pid:org.openhab.mqtt
broker.url=tcp://192.168.1.114:1883
broker.clientId=openhab2
broker.user=openhabian
broker.pwd=openhabian
openhab.log
2018-12-25 12:56:33.766 [ome.event.ItemCommandEvent] - Item ‘Light_GF_Corridor_Ceiling’ received command ON
2018-12-25 12:56:33.815 [vent.ItemStateChangedEvent] - Light_GF_Corridor_Ceiling changed from OFF to ON
2018-12-25 12:56:35.311 [ome.event.ItemCommandEvent] - Item ‘Light_GF_Corridor_Ceiling’ received command OFF
2018-12-25 12:56:35.345 [vent.ItemStateChangedEvent] - Light_GF_Corridor_Ceiling changed from ON to OFF
mosquitto.log
1545721403: New connection from ::1 on port 1883.
1545721403: New client connected from ::1 as mosqsub/2084-openHABian (c1, k60).
1545721521: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
demo.items
Switch Light_GF_Corridor_Ceiling "Ceiling 123" { mqtt=">[mosquitto:/switch/test:command:ON:1],>[mosquitto:/switch/test:command:OFF:0]" }
I’ve been trying to get switch working for the past 2 days, but no luck i require your help to resolve the issue !!
Sorry for my bad English!
best regards,
Tanmay
vzorglub
(Vincent Regaud)
December 25, 2018, 7:56am
2
Which version of the binding did you install? v1 or v2?
Your use of the mqtt.cfg and item bindings is for v1 only.
1 Like
Thank you Vincent for quick response.
I have installed binding from Paper UI.
vzorglub
(Vincent Regaud)
December 25, 2018, 8:20am
4
You have installed the MQTTv2 binding
You need to create a MQTT broker thing
and then an MQTT generic thing
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 …
2 Likes
Thank you very much for your help…!!
vzorglub:
Switch SonoffPs01Switch_Switch “SPS01 Switch” (SonoffPowerSwitches_Basic,ChristmasLivingrooms) { channel=“mqtt:topic:SonoffPs01:switch” } String SonoffPs01Switch_State “SPS01 State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:state01”, channel=“mqtt:topic:SonoffPs01:state02”, channel=“mqtt:topic:SonoffPs01:state03”, channel=“mqtt:topic:SonoffPs01:switch” } Number SonoffPs01Switch_Vcc “SPS01 VCC” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:vcc” } String SonoffPs01Switch_WifiAp “SPS01 Wifi AP” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:wifi-ap” } String SonoffPs01Switch_WifiSsid “SPS01 Wifi SSID” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:wifi-ssid” } String SonoffPs01Switch_WifiChannel “SPS01 Wifi Channel” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:wifi-channel” } String SonoffPs01Switch_WifiRssi “SPS01 Wifi RSSI” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:wifi-rssi” } String SonoffPs01Switch_Uptime “SPS01 Uptime” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:uptime” } String SonoffPs01Switch_Time “SPS01 Time” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:time” } String SonoffPs01Switch_DeviceState “SPS01 Device State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:SonoffPs01:devicestate” }
I am new to openhab so it is very difficult to understand. If you have any simple steps to do it.
vzorglub
(Vincent Regaud)
December 25, 2018, 10:03am
7
Not today, maybe tomorrow.
Christmas day, Children…
1 Like
No Problem…Merry Christmas…!!
vzorglub
(Vincent Regaud)
December 25, 2018, 1:01pm
9
1 Like
I really appreciate @vzorglub to help in getting the MQTT ready. Thank you so much…