Hi all, I hope someone can give me some help with an MQTT issue.
I’m looking at moving from SmartThings to a private solution, so am using MQTT at the moment to bridge from one system to another.
I have configured the MQTT broker and SmartApplication in SmartThings to sync the status of a few controls, I’m focusing on two of them right now, basic switches.
I’ve setup a sitemap in BasicUI that has the two switches bound to the MQTT items. I expect that when I turn or off a light in ST, that the message should cause the appropriate swicth in OH to mirror the action. It doesn’t seem to happen, and when I turn on or off the switch in OH, I don’t see anything on the broker screen.
OpenHAB2 and Mosquitto are running on my NAS (192.168.0.201), the MQTT Broker is currently running on my office desktop (192.168.0.15). Should I have MQTT talking to Mosquitto directly? or should it talk to the MQTT broker?
When I change one of my sample switches in SmartThings, I see the broker get three messages, one from SmartThings, one from MQTT, and a duplicate from SmartThings.
I have restarted the OH service recently to see if there were any startup errors and there didn’t seem to be anything urgent (multiple interfaces found, and it ignores what should be the main one, but can talk with other devices, so I’m not worried).
Also, I’ve been using MQTT.fx to monitor the topics, and only see one message coming in when I press the button in SmartThings.
Here we go with the files, if I forgot anything important let me know.
mqtt.cfg
mosquitto.url=tcp://192.168.0.201:1883
mosquitto.clientId=OpenHAB2_Client
mqtt-eventbus.cfg
<nothing in here>
mqtt.items (I don’t know how wrapping will work, this is two lines)
Switch NigelOffice (lights) {mqtt="<[mosquitto:smartthings/NigelOffice/switch:state:defalt:default],>[mosquitto:smartthings/NigelOffice/switch:command:*:default],autoupdate=false"}
Switch masterbed (lights) {mqtt="<[mosquitto:smartthings/Bedroom switch/switch:state:default:default],>[mosquitto:smartthings/Bedroom switch/switch:command:*:default],autoupdate=false"}
default.sitemap
sitemap default label="My first sitemap"
{
Frame label="MQTT" {
Switch item=masterbed label="Master Bedroom Lights"
Switch item=NigelOffice label="Nigel Office"
}
}
Here’s the log from my MQTT broker showing what happens when I turn on my Office Light
info: Incoming message from SmartThings: smartthings/NigelOffice/switch = off
info: Incoming message from MQTT: smartthings/NigelOffice/switch = off
info: Skipping duplicate message from: smartthings/NigelOffice/switch = off
And finally, here’s the openhab.log file for the recent restart
2018-04-30 16:39:24.183 [INFO ] [er.internal.HomeBuilderDashboardTile] - Started Home Builder at /homebuilder
2018-04-30 16:39:25.728 [WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.0.201
2018-04-30 16:39:25.796 [WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.0.201
2018-04-30 16:39:25.914 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://172.20.2.2:8090
2018-04-30 16:39:25.918 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://172.20.2.2:8444
2018-04-30 16:39:35.599 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mqtt.items'
2018-04-30 16:39:35.750 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'plex.items'
2018-04-30 16:39:38.810 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-04-30 16:39:39.868 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.sitemap'
2018-04-30 16:39:43.489 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-04-30 16:39:43.730 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-04-30 16:39:44.208 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-04-30 16:39:44.979 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2018-04-30 16:39:45.408 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldPower bound to client 1e7ad18b9f2c88b5-com-plexapp-android property power
2018-04-30 16:39:45.428 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldStatus bound to client 1e7ad18b9f2c88b5-com-plexapp-android property state
2018-04-30 16:39:45.433 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTitle bound to client 1e7ad18b9f2c88b5-com-plexapp-android property title
2018-04-30 16:39:45.437 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldType bound to client 1e7ad18b9f2c88b5-com-plexapp-android property type
2018-04-30 16:39:45.442 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldCover bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/cover
2018-04-30 16:39:45.453 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldProgress bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/progress
2018-04-30 16:39:45.461 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldEndTime bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/endTime
2018-04-30 16:39:45.465 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTVVolume bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/volume
2018-04-30 16:39:45.469 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTVPause bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/pause
2018-04-30 16:39:45.476 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTVPlay bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/play
2018-04-30 16:39:45.483 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTVPlayPause bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/playpause
2018-04-30 16:39:45.486 [INFO ] [.internal.PlexGenericBindingProvider] - Plex item ShieldTVStop bound to client 1e7ad18b9f2c88b5-com-plexapp-android property playback/stop
2018-04-30 16:39:49.091 [INFO ] [b.core.service.AbstractActiveService] - Plex Refresh Service has been started
2018-04-30 16:39:50.018 [INFO ] [.binding.plex.internal.PlexConnector] - Plex websocket connected to 192-168-0-201.626cfd8fa5d94ba7b1dd38fb9288bdbf.plex.direct:32400
I don’t see anything in the logs I am worried about (but I might not know enough).
Thanks for any help with this, I spent all of yesterday afternoon and evening bashing my head against this, and fixed about a dozen things to get to this point.