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âŠ