OpenHAB Mysensors binding 2.4: cant get mqtt gateway online
-
Hello, im trying to get mysensors binding to work in openHAB with mqtt gateway. I can get it to work with ethernet or serial gateway but i need mqtt gateway. Hardware is properly setup. I know this because i can connect to mqtt gateway with mycontroller and see all connected nodes and sensors. When i look at the mosquitto broker i can see the messages sent by the gateway. But my mqtt gateway thing stays offline in openHAB paperUi. I guess there is a problem with my mqtt.cfg or mqtt-eventbus.cfg. there isnt alot of documentation out there. I did find an example of how the config files should look in openHAB 2.2 & 2.3 but im running 2.4 and appearently the same .cfg doesnt work. I've been breaking my head over this for the last 3 days but cant find anything on the forums to solve my problem (it gets very confusing, considering the various approaches: mqtt binding1 vs mqtt binding2 vs mysensors binding). Does anyone have the mqtt gateway running in openhab 2.4 using the mysensors binding? Im really lost, any help would be much appreciated. Thanks
-
@jimmy-loyens It seems like the MQTT-gateway thing doesn't connect to mosquitto, I should mention i have the espMiLight binding running wich allso goes over mqtt (wich does connect to mosquitto). When i look in the mosquitto logs i can see the espMiLight bridge connect from IP of openhab but i never see MySensors bridge connect to mosquitto:
[13:15:53] openhabian@openHABianPi:~$ mosquitto -p 1883 -v 1548159358: mosquitto version 1.4.10 (build date Wed, 17 Oct 2018 19:03:03 +0200 ) starting 1548159358: Using default config. 1548159358: Opening ipv4 listen socket on port 1883. 1548159358: Opening ipv6 listen socket on port 1883. 1548159358: New connection from 192.168.1.4 on port 1883. 1548159358: New client connected from 192.168.1.4 as mysensors-1 (c1, k15, u'ope nhabian'). 1548159358: Sending CONNACK to mysensors-1 (0, 0) 1548159358: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/0 /255/0/0/18', ... (5 bytes)) 1548159358: Received SUBSCRIBE from mysensors-1 1548159358: mygateway1-in/+/+/+/+/+ (QoS 0) 1548159358: mysensors-1 0 mygateway1-in/+/+/+/+/+ 1548159358: Sending SUBACK to mysensors-1 1548159359: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/1 07/3/1/0/0', ... (2 bytes)) 1548159359: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/1 07/2/1/0/0', ... (4 bytes)) 1548159359: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/1 07/1/1/0/1', ... (4 bytes)) 1548159361: New connection from 192.168.1.2 on port 1883. 1548159361: New client connected from 192.168.1.2 as espMilightHub:001 (c1, k15, u'openhabian'). 1548159361: Sending CONNACK to espMilightHub:001 (0, 0) 1548159361: Received SUBSCRIBE from espMilightHub:001 1548159361: milight/states/# (QoS 1) 1548159361: espMilightHub:001 1 milight/states/# 1548159361: Sending SUBACK to espMilightHub:001 1548159363: New connection from 192.168.1.5 on port 1883. 1548159363: New client connected from 192.168.1.5 as milight-hub-8661470 (c1, k1 5, u'openhabian').
192.168.1.2 => ip openhab server
192.168.1.4 => ip mqtt gateway
192.168.1.5 => ip milight hub
If i am right there should be 2 more lines like this:New connection from 192.168.1.2 on port 1883. New client connected from 192.168.1.2 as mysensors:gateway (c1, k15, u'openhabian').
but these lines never show up in mosquitto log
These are the logs i get when trying to add a mqtt gateway from paperUI:2019-01-22 13:54:57.181 [TRACE] [sors.factory.MySensorsHandlerFactory] - Creating handler for thing: mysensors:bridge-mqtt:bd653924 2019-01-22 13:54:57.195 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge ==> /var/log/openhab2/events.log <== 2019-01-22 13:54:57.196 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:bd653924' changed from UNINITIALIZED to INITIALIZING ==> /var/log/openhab2/openhab.log <== 2019-01-22 13:54:57.203 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache file: given_ids.cached exist. 2019-01-22 13:54:57.208 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache (given_ids) content: [0, 11, 107] 2019-01-22 13:54:57.212 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Enabling connection watchdog 2019-01-22 13:54:57.216 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@5be142 to org.openhab.binding.mysensors.internal.event.EventRegister@646dd1 2019-01-22 13:54:57.219 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@10cfe20 to org.openhab.binding.mysensors.internal.event.EventRegister@646dd1 2019-01-22 13:54:57.225 [TRACE] [nsors.handler.MySensorsBridgeHandler] - Registering MySensorsDiscoveryService for bridge 'bd653924' 2019-01-22 13:54:57.224 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - No connection to broker: mosquitto 2019-01-22 13:54:57.232 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@16f7c2 to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@5be142 2019-01-22 13:54:57.236 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=0, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@5be142 2019-01-22 13:54:57.239 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=0, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@10cfe20 2019-01-22 13:54:57.243 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=11, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@5be142 2019-01-22 13:54:57.247 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=11, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@10cfe20 2019-01-22 13:54:57.251 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=107, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@5be142 2019-01-22 13:54:57.253 [DEBUG] [org.openhab.binding.mysensors ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=518, service.bundleid=263, service.scope=singleton} - org.openhab.binding.mysensors 2019-01-22 13:54:57.255 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=107, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@10cfe20 2019-01-22 13:54:57.258 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@16f7c2 to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@10cfe20 ==> /var/log/openhab2/events.log <== 2019-01-22 13:54:57.269 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:bd653924' changed from INITIALIZING to OFFLINE ==> /var/log/openhab2/openhab.log <== 2019-01-22 13:54:57.275 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [0,11,107] 2019-01-22 13:54:57.279 [DEBUG] [.discovery.MySensorsDiscoveryService] - Starting MySensors discovery scan 2019-01-22 13:54:57.282 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Failed connecting to bridge...next retry in 10 seconds (Retry No.:0) 2019-01-22 13:54:57.282 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService@1e34cba to org.openhab.binding.mysensors.internal.event.EventRegister@646dd1 2019-01-22 13:54:57.285 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge DONE!
For some reason openhab cant connect the mqtt gateway thing to mosquitto, it can however connect the espMiLight hub to mosquitto no problem.
The mqtt gateway itself is happely spewing data wich arrives at the mosquitto broker:
[14:05:04] openhabian@openHABianPi:~$ mosquitto_sub -u openhabian -P y -p 1883 -v -t 'mygateway1-out/#' mygateway1-out/107/3/1/0/0 28 mygateway1-out/107/0/1/0/0 91 mygateway1-out/107/2/1/0/0 20.1 mygateway1-out/107/1/1/0/1 45.4 mygateway1-out/107/2/1/0/0 20.6 mygateway1-out/107/1/1/0/1 43.2
I have serial binding and mqtt binding v2 installed. I have both mqtt.cfg and org.eclipse.smarthome.mqtt.cfg configured as follows:
# # Define your MQTT broker connections here for use in the MQTT Binding or MQTT # Persistence bundles. Replace <broker> with an ID you choose. # URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883 mqtt:mosquitto.url=tcp://localhost:1883 # Optional. Client id (max 23 chars) to use when connecting to the broker. # If not provided a random default is generated. mqtt:mosquitto.clientId=openHab # Optional. True or false. If set to true, allows the use of clientId values # up to 65535 characters long. Defaults to false. # NOTE: clientId values longer than 23 characters may not be supported by all # MQTT servers. Check the server documentation. #mqtt:mosquitto.allowLongerClientIds=false # Optional. User id to authenticate with the broker. mqtt:mosquitto.user=openhabian # Optional. Password to authenticate with the broker. mqtt:mosquitto.pwd=y # Optional. Set the quality of service level for sending messages to this broker. # Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2 # (Deliver exactly once). Defaults to 0. mqtt:mosquitto.qos=1 # Optional. True or false. Defines if the broker should retain the messages sent to # it. Defaults to false. #mqtt:mosquitto.retain=true # Optional. True or false. Defines if messages are published asynchronously or # synchronously. Defaults to true. #mqtt:mosquitto.async=false # Optional. Defines the last will and testament that is sent when this client goes offline # Format: topic:message:qos:retained <br/> #mqtt:mosquitto.lwt=<last will definition>
I've been at this for 4 days now and i really want to pull my hear out
-
@jimmy-loyens Hi Jimmy. I'm trying to help, but being a complex issue I'm a little lost.
Have you tried the mysensors+mqtt combo without OpenHAB and it's working ok? I would recommend mycontroller.org as a starting point.
I also recommend mqtt.fx client in order to see the mqtt messages. Try to understand them and if possible send some to your sensors.
If and only if the mysensors+mqtt it's ok, then go to openhab.
In PaperUI you should create a thing for the broker. Have you already? Then after the thing for the broker, you have to create a thing for the gateway. And then if both of them are ok, you can discover your sensors.
Please have a look at some of my screens. I have several brokers because I was also very confused. You only need one.
-
@guillermo-schimmel Hi guilleromo, thanks for staying with me.
I have a broker setup and online,
mqtt:broker:mosquito [ host="192.168.1.2", port=1883, qos=1, clientID="openHAB2", reconnectTime=20000, keepAlive=60000, secure=false, username="openhabian", password="xxxx" ]
If i create a thing for the gateway i can see the gateway in paperUI but i cant managet to get it online
Bridge mysensors:bridge-mqtt:gateway2 [ brokerName="mosquitto", username="openhabian", password="xxxx", topicPublish="mygateway1-in", topicSubscribe="mygateway1-out", startupCheckEnabled=false ]
(This line probably looks formilliar, its the same you use with addition of username & password)
In the log it says: "No connection to broker: mosquitto" and i think this is the whole problem since i can see the messages from the gateway appearing on mosquitto when i do:
"mosquitto_sub -u openhabian -P y -p 1883 -v -t 'mygateway1-out/#'"
i can allso see the messages on my phone using an mqtt client perscribing to the same topic. But i'm downloading mqtt.fx as i type
-
@jimmy-loyens You have some mosquito/mosquitto mismatch. Have you noticed?
-
@guillermo-schimmel No I had not noticed thanks. Corrected it but so far GW stays offline. I have deleted and restarted these files so often over the past coupple of days, this was a fresh file from today
just did a global search in my files, this was the only occurrence of the misspelling
-
@jimmy-loyens This binding is a little raw. Perhaps you would like to restart the whole OpenHAB.
Also you should enable more debugging in
openhab-cli console
. Specificaly to mysensors binding and mqtt.
-
@guillermo-schimmel I allready have TRACE on for mysensors binding, i will turn it on for mqtt to (if i can find bundle name). Do you mean reboot openhab server? No problem that will be reboot nr167 for today
-
@jimmy-loyens turned on TRACE logging for mqtt transport, mqtt binding & mqtt thing binding. TRACE logging was allready on for mysensors binding.
Openhab server rebooted.But gateway doesnt come online
This is everything logged about mqtt:
2019-01-22 15:39:26.350 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - BundleEvent STARTING - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:39:26.420 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=482, service.bundleid=270, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.internal.discovery.MqttServiceDiscoveryService, component.id=321} - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:39:26.457 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory, org.eclipse.smarthome.binding.mqtt.discovery.MQTTTopicDiscoveryService}={service.id=483, service.bundleid=270, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.internal.MqttBrokerHandlerFactory, component.id=322} - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:39:26.483 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingActions}={service.id=484, service.bundleid=270, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.action.MQTTActions, component.id=323} - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:39:26.494 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - BundleEvent STARTED - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:39:26.514 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - BundleEvent STARTING - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.598 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=485, service.bundleid=271, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.generic.internal.discovery.HomeAssistantDiscovery, component.id=324} - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.626 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.type.ChannelTypeProvider, org.eclipse.smarthome.core.thing.type.ChannelGroupTypeProvider, org.eclipse.smarthome.binding.mqtt.generic.internal.generic.MqttChannelTypeProvider}={service.id=486, service.bundleid=271, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.generic.internal.generic.MqttChannelTypeProvider, component.id=325} - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.643 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=487, service.bundleid=271, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.generic.internal.discovery.Homie300Discovery, component.id=326} - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.665 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.eclipse.smarthome.binding.mqtt.generic.internal.generic.MqttChannelStateDescriptionProvider}={service.id=488, service.bundleid=271, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.generic.internal.generic.MqttChannelStateDescriptionProvider, component.id=327} - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.700 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=489, service.bundleid=271, service.scope=bundle, component.name=org.eclipse.smarthome.binding.mqtt.generic.internal.MqttThingHandlerFactory, component.id=328} - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:39:26.722 [DEBUG] [lipse.smarthome.binding.mqtt.generic] - BundleEvent STARTED - org.eclipse.smarthome.binding.mqtt.generic 2019-01-22 15:40:38.064 [TRACE] [sors.factory.MySensorsHandlerFactory] - Creating handler for thing: mysensors:bridge-mqtt:gateway2 2019-01-22 15:40:38.090 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:gateway2' changed from UNINITIALIZED to INITIALIZING 2019-01-22 15:40:38.115 [DEBUG] [org.eclipse.smarthome.binding.mqtt ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingActions}={service.id=510, service.bundleid=270, service.scope=singleton} - org.eclipse.smarthome.binding.mqtt 2019-01-22 15:40:38.130 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from UNINITIALIZED to INITIALIZING 2019-01-22 15:40:38.194 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Enabling connection watchdog 2019-01-22 15:40:38.197 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from INITIALIZING to OFFLINE 2019-01-22 15:40:38.222 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - No connection to broker: mosquitto 2019-01-22 15:40:38.245 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@c41f03 to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 2019-01-22 15:40:38.266 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@c41f03 to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 2019-01-22 15:40:38.274 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:gateway2' changed from INITIALIZING to OFFLINE 2019-01-22 15:40:38.281 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Failed connecting to bridge...next retry in 10 seconds (Retry No.:0) 2019-01-22 15:40:38.368 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.2' with clientid openHAB2 and file store '/var/lib/openhab2/mqtt/192.168.1.2' 2019-01-22 15:40:38.386 [TRACE] [ternal.TopicSubscribeMultiConnection] - Found suitable bridge mqtt:broker:mosquitto for listing to topic homie/+/$homie 2019-01-22 15:40:38.388 [TRACE] [ternal.TopicSubscribeMultiConnection] - Found suitable bridge mqtt:broker:mosquitto for listing to topic homeassistant/# 2019-01-22 15:40:38.407 [TRACE] [.transport.mqtt.MqttBrokerConnection] - subscribeRaw message consumer for topic 'homeassistant/#' from broker '192.168.1.2' 2019-01-22 15:40:38.413 [TRACE] [.transport.mqtt.MqttBrokerConnection] - subscribeRaw message consumer for topic 'homie/+/$homie' from broker '192.168.1.2' 2019-01-22 15:40:38.424 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from OFFLINE to ONLINE```
-
@jimmy-loyens And everything logged for mysensors binding:
2019-01-22 15:39:45.027 [DEBUG] [org.openhab.binding.mysensors ] - BundleEvent STARTING - org.openhab.binding.mysensors 2019-01-22 15:39:45.130 [DEBUG] [org.openhab.binding.mysensors ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=507, service.bundleid=263, service.scope=bundle, component.name=org.openhab.binding.mysensors.factory.MySensorsHandlerFactory, component.id=341} - org.openhab.binding.mysensors 2019-01-22 15:39:45.143 [DEBUG] [org.openhab.binding.mysensors ] - BundleEvent STARTED - org.openhab.binding.mysensors 2019-01-22 15:40:38.064 [TRACE] [sors.factory.MySensorsHandlerFactory] - Creating handler for thing: mysensors:bridge-mqtt:gateway2 2019-01-22 15:40:38.090 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:gateway2' changed from UNINITIALIZED to INITIALIZING 2019-01-22 15:40:38.106 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge 2019-01-22 15:40:38.158 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache file: given_ids.cached exist. 2019-01-22 15:40:38.163 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache (given_ids) content: [0, 11, 107] 2019-01-22 15:40:38.194 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Enabling connection watchdog 2019-01-22 15:40:38.197 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 to org.openhab.binding.mysensors.internal.event.EventRegister@c0307f 2019-01-22 15:40:38.199 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 to org.openhab.binding.mysensors.internal.event.EventRegister@c0307f 2019-01-22 15:40:38.204 [TRACE] [nsors.handler.MySensorsBridgeHandler] - Registering MySensorsDiscoveryService for bridge 'gateway2' 2019-01-22 15:40:38.220 [DEBUG] [org.openhab.binding.mysensors ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=511, service.bundleid=263, service.scope=singleton} - org.openhab.binding.mysensors 2019-01-22 15:40:38.222 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - No connection to broker: mosquitto 2019-01-22 15:40:38.233 [DEBUG] [.discovery.MySensorsDiscoveryService] - Starting MySensors discovery scan 2019-01-22 15:40:38.245 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@c41f03 to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 2019-01-22 15:40:38.252 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=0, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 2019-01-22 15:40:38.254 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=0, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 2019-01-22 15:40:38.256 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=11, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 2019-01-22 15:40:38.258 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=11, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 2019-01-22 15:40:38.261 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=107, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.internal.gateway.MySensorsGateway@16ae66 2019-01-22 15:40:38.263 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event MySensorsNode [nodeId=107, childNumber=0, chidldList={}] to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 2019-01-22 15:40:38.266 [TRACE] [nternal.event.MySensorsEventRegister] - Broadcasting event org.openhab.binding.mysensors.internal.protocol.mqtt.MySensorsMqttConnection@c41f03 to: org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@86c4a7 2019-01-22 15:40:38.274 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:gateway2' changed from INITIALIZING to OFFLINE 2019-01-22 15:40:38.277 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [0,11,107] 2019-01-22 15:40:38.280 [TRACE] [sensors.internal.event.EventRegister] - Adding listener org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService@10bffbb to org.openhab.binding.mysensors.internal.event.EventRegister@c0307f 2019-01-22 15:40:38.281 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Failed connecting to bridge...next retry in 10 seconds (Retry No.:0) 2019-01-22 15:40:38.282 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge DONE!
It says "Failed connecting to bridge...next retry in 10 seconds (Retry No.:0)" but no retry is ever done to reconnect.
-
@jimmy-loyens I allso have no problem publishing messages to the broker from MQTT.fx.
I currently have no actuator nodes, only sensor nodes so i cant see if gateway sends message on to nodes.If i just send message: "mygateway1-in/170/4/1/0/16 0" to a node that has a door contact on child 4, should this message show up in the serial monitor?
otherwise i can reflash the node with a relay sketch
-
@jimmy-loyens Sorry man. I'm lost. we should try to contact the author of mysensors-binding.
The only advice that I have right now. What I would do: Delete all mysensors-mqtt config. Delete openhab caches (a very big json file).
Start again very simple.
-
@guillermo-schimmel Dont worry about it you tried! Do you know who that is?
Where can i find "openhab caches"
-
@jimmy-loyens https://forum.mysensors.org/topic/7176/openhab-2-2-binding
he is usually at that thread. very nice guy.
Lots of info on that thread also.
-
Is this ok in your installation?
openhab> bundle:list|grep My 191 โ Active โ 80 โ 2.4.0.201812040738 โ MySensors Binding
-
@guillermo-schimmel I will give it a try, thank you very much for all your efford. I think i will be needing a little brake right now so since its snowing over here i'll go sleeing with my doughter then start over fresh.
Thanks again
-
@guillermo-schimmel said in OpenHAB Mysensors binding 2.4: cant get mqtt gateway online:
bundle:list|grep My
openhab> bundle:list|grep My 263 x Active x 80 x 2.4.0.201812040738 x MySensors Binding openhab>
yes, its active. but for some reason it looks different
-
Hey @jimmy-loyens !
I needed some time to investigate the problem and after looking into it, I've no clue why this is working for you @Guillermo-Schimmel .
With version 2.4.0 and the changes to the mqtt binding I'm not able to connect the MySensors binding to the MQTT broker connection configured in OpenHAB. The MySensors binding uses the MQTT implementation and connection of OpenHAB, it does not connect to the broker itself.
And now the funny part: my development system works fine, so I need to find a way to debug this problem.
@Guillermo-Schimmel Did you configure broker and things in PaperUI or in textual files?
-
@timo said in OpenHAB Mysensors binding 2.4: cant get mqtt gateway online:
Hey @jimmy-loyens !
I needed some time to investigate the problem and after looking into it, I've no clue why this is working for you @Guillermo-Schimmel .
With version 2.4.0 and the changes to the mqtt binding I'm not able to connect the MySensors binding to the MQTT broker connection configured in OpenHAB. The MySensors binding uses the MQTT implementation and connection of OpenHAB, it does not connect to the broker itself.
And now the funny part: my development system works fine, so I need to find a way to debug this problem.
@Guillermo-Schimmel Did you configure broker and things in PaperUI or in textual files?
Some in files, some in Paper UI.
I think I have a mess, but don't want to touch it because it's working so nicely...
-
have a look
Bridge mqtt:broker:mosquittotexto [ host="localhost", port="8884", secure=false, brokername="mosquitto", topicPublish="mysensors1-in", topicSuscribe="mysensors1-out", startupCheckEnabled=false ] { Thing mqtt:topic:miscosas { Channels: Type number : ecovacs_1_battery_level "Ecovacs 01 Battery Level" [ stateTopic="ecovacs/E0000693817701104736/battery_level" ] Type string : ecovacs_1_charge_status "Ecovacs 01 Charge Status" [ stateTopic="ecovacs/E0000693817701104736/charge_status" ] Type string : ecovacs_1_clean_status "Ecovacs 01 Clean Status" [ stateTopic="ecovacs/E0000693817701104736/clean_status" ] Type string : ecovacs_1_vacuum_status "Ecovacs 01 Vacuum Status" [ stateTopic="ecovacs/E0000693817701104736/vacuum_status" ] Type string : ecovacs_1_fan_speed "Ecovacs 01 Fan Speed" [ stateTopic="ecovacs/E0000693817701104736/fan_speed" ] Type number : ecovacs_1_main_brush "Ecovacs 01 Main Brush" [ stateTopic="ecovacs/E0000693817701104736/components/main_brush" ] Type number : ecovacs_1_side_brush "Ecovacs 01 Side Brush" [ stateTopic="ecovacs/E0000693817701104736/components/side_brush" ] Type number : ecovacs_1_filter "Ecovacs 01 Filter" [ stateTopic="ecovacs/E0000693817701104736/components/filter" ] Type number : ecovacs_1_ncommand "Ecovacs 01 Number Command" [ commandTopic="ecovacs/E0000693817701104736/command" ] Type string : porton_a_mano "Garage Porton a Mano" [ stateTopic="mygateway1-out/11/3/1/0/16" ] Type number : server_nextcloud_disk_root "Server Nextloud Root Partition" [ stateTopic="servers/nextcloud/disk/root" ] Type number : server_bluecherry_disk_root "Server Bluecherry Root Partition" [ stateTopic="servers/bluecherry/disk/root" ] } }
-
@guillermo-schimmel You've mixed up attributes from the MySensors binding and the MQTT binding in the bridge definition. brokerName, topicSubscribe and so on are attributes from the MySensors binding. But this won't do any harm.
How is the MySensors gateway defined?
-
@timo Mysensors gateway is defined via Paper UI:
-
@timo said in OpenHAB Mysensors binding 2.4: cant get mqtt gateway online:
@guillermo-schimmel You've mixed up attributes from the MySensors binding and the MQTT binding in the bridge definition. brokerName, topicSubscribe and so on are attributes from the MySensors binding. But this won't do any harm.
Thanks, cleaned up config file:
Bridge mqtt:broker:mosquittotexto [ host="localhost", port="8884", secure=false, startupCheckEnabled=false ] { Thing mqtt:topic:miscosas { Channels: Type number : ecovacs_1_battery_level "Ecovacs 01 Battery Level" [ stateTopic="ecovacs/E0000693817701104736/battery_level" ] Type string : ecovacs_1_charge_status "Ecovacs 01 Charge Status" [ stateTopic="ecovacs/E0000693817701104736/charge_status" ] Type string : ecovacs_1_clean_status "Ecovacs 01 Clean Status" [ stateTopic="ecovacs/E0000693817701104736/clean_status" ] Type string : ecovacs_1_vacuum_status "Ecovacs 01 Vacuum Status" [ stateTopic="ecovacs/E0000693817701104736/vacuum_status" ] Type string : ecovacs_1_fan_speed "Ecovacs 01 Fan Speed" [ stateTopic="ecovacs/E0000693817701104736/fan_speed" ] Type number : ecovacs_1_main_brush "Ecovacs 01 Main Brush" [ stateTopic="ecovacs/E0000693817701104736/components/main_brush" ] Type number : ecovacs_1_side_brush "Ecovacs 01 Side Brush" [ stateTopic="ecovacs/E0000693817701104736/components/side_brush" ] Type number : ecovacs_1_filter "Ecovacs 01 Filter" [ stateTopic="ecovacs/E0000693817701104736/components/filter" ] Type number : server_bluecherry_disk_root "Server Bluecherry Root Partition" [ stateTopic="servers/bluecherry/disk/root" ] } }
Restarted all, still all working fine.
-
@guillermo-schimmel OK, next question: how did you define the system broker named mosquitto? Because that's the one the MySensors binding seems to use. In a service (cfg) file? I've had no success defining one and maybe that's the key.
-
@timo Via files. It was the old broker I was using with the 1.x mqtt binding.
-
If I can do anything to help please let me know
-
I had a working mqtt-gw but the lastest update (using openhabian so updates every time with system) screwed up my system. I have reloaded the binding and also rebuilt the gw (Rpi) to get newest MySensors version.
Haven't had time to troubleshoot yet.
Binding behind after latest update?
-
@masmat Hi, I think @TimO is looking into it. Ethernet and serial gateway work as expected with mysensors binding. My guess it has something to do with new MQTT-binding.
-
@masmat said in OpenHAB Mysensors binding 2.4: cant get mqtt gateway online:
I had a working mqtt-gw but the lastest update (using openhabian so updates every time with system) screwed up my system. I have reloaded the binding and also rebuilt the gw (Rpi) to get newest MySensors version.
Haven't had time to troubleshoot yet.
Binding behind after latest update?same here, updated from 2.4.0 to 2.5.0 snapshot and it died.
I was using an MQTT broker solely configured via paperui and it worked like a dream. 2.5.0 - not so much.
-
@TimO @davidgraeff
I don't know if this is of any use or not but many hours later in my openhab.log I received this:2019-01-31 06:05:37.371 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleComm$ java.lang.NullPointerException: null at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.sendMessage(MySensorsGateway.java:366) ~[?:?] at org.openhab.binding.mysensors.handler.MySensorsThingHandler.handleCommand(MySensorsThingHandler.java:200) ~[?:?] at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:or$ at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smart$ at com.sun.proxy.$Proxy202.handleCommand(Unknown Source) [187:org.openhab.binding.mysensors:2.4.0.201812040738] at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.ec$ at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:$ at sun.reflect.GeneratedMethodAccessor149.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:or$ at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.11.0.2019011$ at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?]
-
I've still found no solution but if I use the new embedded broker in OpenHAB2 and connect the the MySensors MQTT gateway to that broker everything works fine.
But I'd no success in connecting the MySensors MQTT gateway to a working MQTT-broker (MQTT2) or in creating a SystemBroker (MQTT2).So for those of you that are willing to use the embeeded broker, this works fine with the MySensors MQTT gateway.
Just use embedded-mqtt-broker as broker name in the MQTT gateway configuration.
-
@timo thanks for the update. I will try it as soon as i get the chance. Thanks
-
@timo
works for me, will try it out.also, i got it working another way. tested it on clean installs of 2.4.0 vs 2.5.0-1512
back to the config file org.eclipse.smarthome.mqttbroker.cfg
not sure why it didn't work in 2.5.0 the first time. i'm starting to think it was leftover in the userdata folder which is why i thought it was no longer necessary in the services directorybut, if i can skip it altogether and user the system broker then i'm just as happy with that. one less thing.
BTW, for anyone who happens along this thread in the future: literally the only two bindings you need to install in 2.4.0-2.5.0 is the serial binding and the mqtt (2.x) binding. then drop the mysensors binding in. that's it. it's so much easier now.
-
@timo I connected to the embedded broker over port 1884
. But i cant seem to discover my nodes. This is my broker thing:mqtt:broker:embedded-mqtt-broker[host="192.168.1.2", port="1884", qos=1, clientID="gateway1", reconnectTime=20000, keepAlive=60000, secure=false, username="xxx", password="yyy"]
This is my mqtt-bridge thing:
Bridge mysensors:bridge-mqtt:mygateway [brokerName="embedded-mqtt-broker", port="1884", topicPublish="mygateway1-in", topicSubscribe="mygateway1-out", startupCheckEnabled=false]{ }
Its weird because i can see the messages from the nodes coming in in the log vieuwer (mysensors binding is in TRACE).
2019-02-06 16:47:14.968 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/0' : 87 2019-02-06 16:47:14.971 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:14.990 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/1/1/0/1' : 37.2 2019-02-06 16:47:14.993 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/1/1/0/1' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:15.024 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:47:15.028 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:26.746 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:47:26.748 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:34.072 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:34.075 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:37.114 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:37.116 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:38.438 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/1/1/0/1' : 37.3 2019-02-06 16:47:38.441 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/1/1/0/1' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:38.459 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:47:38.462 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:40.157 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:40.160 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:43.224 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:43.226 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:50.169 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:47:50.172 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:56.542 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:56.545 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:47:59.582 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:47:59.585 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:01.876 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:48:01.879 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:02.648 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:02.653 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:05.680 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:05.682 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:13.580 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:48:13.583 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:25.308 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:48:25.312 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:25.454 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:25.458 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:28.486 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:28.489 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:31.551 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:31.553 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:34.585 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:34.588 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:37.006 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/1/1/0/1' : 37.2 2019-02-06 16:48:37.008 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/1/1/0/1' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:37.039 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:48:37.042 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:44.873 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:44.875 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:47.916 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:47.919 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:48.720 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/3/1/0/23' : 31 2019-02-06 16:48:48.722 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/3/1/0/23' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:48.744 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/2/1/0/0' : 22.7 2019-02-06 16:48:48.746 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/2/1/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:48.762 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/1/1/0/1' : 37.3 2019-02-06 16:48:48.764 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/1/1/0/1' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:48.786 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/109/255/3/0/32' : 500 2019-02-06 16:48:48.788 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/109/255/3/0/32' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:50.971 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:50.973 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]* 2019-02-06 16:48:54.038 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'mygateway1-out/1/255/4/0/0' : 0200010068057A890103 2019-02-06 16:48:54.044 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'mygateway1-out/1/255/4/0/0' using regex mygateway1-out/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*
And can you point me to the docs on how to setup the binding ? I found them before but cant seem to find them anymore.
Thanks
-
@jimmy-loyens Could you please check if the embedded-mqtt-broker thing is online? I suppose not. If the embedded broker addon (misc) is installed OpenHAB automatically discovers this embedded broker, just add that thing from inbox.
Now connect your MySensors MQTT gateway (hardware) to the IP and Port of the embedded-broker. After that your MySensors-bridge configuration should work. The port configuration at this point is not needed, but should do no harm, it'll be ignored.Documentation for the binding: https://github.com/tobof/openhab2-addons/wiki
-
is there any reason to prefer MQTT over Ethernet? If getting MQTT to work is this much of a pain why are we bothering?
Maybe I'm missing something
-
@waspie it's not so much pain. I have it working fine. Setup could be simpler, but it works.
The main advantage, at least for me, is unifying all over mqtt. I have mysensors, but also some server monitoring scripts, a vacuum cleaner control, etc.
It's really nice to have a single layer of abstraction between openhab and everything else.
-
@waspie you're able to use more than one controller with the MQTT gateway. So while using Openhab for automation you may use My Controller for wireless node updates / firmware uploads. That is not yet possible with the binding.
-
I'm still planning to use MQTT as I have it tied to about 20 esp8266s around the house so I would never abandon it
One problem I'm having now that I switched over to the embedded broker is the LWT doesn't seem to work right.
I have a module in each car that when it disconnects send a LWT of off so I know to automatically close garage doors. Using the embedded broker has broken this for some reason??? So I start to think why not just use ethernet for mysensors. Fix one problem create 10 more
-
@waspie Well, I do use an MySensors ethernet gateway with the MySensors binding which works fine.
In addition to that I have MQTT devices, for example may heating unit (ebusd) which I connect via Mosquitto and the generic MQTT binding to OpenHAB. MySensors is not involved here.
My advice: use the ethernet gateway with the MySensors binding and keep Mosquitto for the rest. There were some changes in the MQTT implementation of Openhab in 2.4 which lead to some problems, like the one in this thread and I've found some more, while trying to adapt the new configuration and I'm sure there will be some changes to that in the next release. I'm currently using two Openhab instances (2.3 and 2.4) in parallel till all problems are solved.
-
@timo Hi Tomo.
Both the embedded broker thing and the mqtt gateway are online, i can see the mqtt messages in the logvieuwer but i cant discover nodes. I should say i have mosquitto running on port 1883 (for my milight hub) and embedded broker on port 1884. Do you think this is a problem? can i have both brokers on 1883? btw thanks for the link
-
@jimmy-loyens
1 broker per port otherwise one won't start. Sounds like mys is connecting to 1883 and not 1884
-
@waspie I think the embedded broker connects to 1884 since i can see the messages from my nodes. But you might be right that mysensors is connecting to the wrong broker/port. Allso noticed the embedded broker is really slowing down my RPI3. Just uninstalled it and everything speeds up again Guess i have to wait till everything can connect to mosquitto
-
i may tinker with things some more in the next day or two to see if i can get MYS to connect to an external broker. i'm assuming @TimO knows best and if he can't get it to work i probably can't either but i'm not in love with how the embedded broker works (plus all the extra garbage it puts in the logs).
-
@waspie Well, it's working for @Guillermo-Schimmel and it's working in my development environment. This bugs the hell out of me. But maybe that's a problem that will be fixed with a update to OH2.
-
It works for you with an external broker?
-
@waspie I'm testing the binding against a mosquitto in my development environment (eclipse IDE) and it is working fine there. That makes it so hard for me to debug the issue.
-
Hello!
I currently have a working Openhab2.2 with mqtt1 binding + mosquitto + MySensors MQTT gateway (+ others) installed in RPi. As I'm migrating the Openhab install to FreeNas jail I figure I should try to use the latest versions of the openhab + bindings.
But it seems that I'm facing the same issue as others: cant get my MySensor mqtt Gateway to connect to an external mqtt broker.
What I've tried was a clean install of Openhab 2.4 + mqtt2 binding + MySensor 2.4 binding, then configuring a Mqtt broker Thing (stays online) and finally a MySensor Gateway binding (never connects, show "No connection to broker: <whatever name I use>")
I tried using the embedded Mqtt and the gateway was able to connect (but I didn't check if messages were coming/going as I will definitely use an external mqtt server)
As a Java programmer myself, I tried to check the code in Github (next step will be try to create a local dev env, but for that I'll need more time to check the right steps for that) and the only odd things I notice were:
Dependency on old mqtt1 code, e.g.: the "MySensorsMqttConnection,java" class is using the MqttService from the package org.eclipse.smarthome.io.transport.mqtt.
- Is this package correct? it seems that it is the old mqtt binding code. The Mqtt stuff I found in openhab2-addons seems to use openhab packages.
a. Where would this smarthome package code be?
Potential Class version differences:
2. I have no idea (and didn't check the provided jar for the MySensor plugin) how the dependencies are managed in openhab runtime, but could it be that the MySensors package depends (or packs) a different version of the "core" mqtt code than the one that openhab2 runtime classloader is providing? then weird things could happen (if method signatures/classes are same I guess)
- Is this package correct? it seems that it is the old mqtt binding code. The Mqtt stuff I found in openhab2-addons seems to use openhab packages.
-
By creating the file org.eclipse.smarthome.mqttbroker.cfg in the service folder (/usr/local/etc/openhab2/services in my case, chown to openhab), with the contents
name=mosquitto host=192.168.1.69 secure=false port=1883 username= password= retain=true
I was able to just create the MySensors MQTT gateway (using paperui) and it stayed online (no mqtt broker defined, but its addon is installed). I had the impressions that with the latest versions it should be possible to do everything in the PaperUI, and that the broker would use the mqtt2 addon (but in paper ui, service, config, mqtt tab, mqtt system broker connection, manage->plus button -> expert mode, I get to see the contents of the cfg file above)
But unfortunately, it seems that the discovery services enters a endless loop (maybe I need to update my arduinos sketch to the latest mysensors code?) and I don't get any auto discovered things. If I trigger a new discovery it will stop the previous one and start again.
Finally, I was able to manually create a thing, and link items on it. Eventually my battery level and humidity were displayed in the paper ui control page (after some weird delay, not updating once it shows in the log. the temperature didn't show up though).
Not sure if my understanding is off (or paperui is limited in this sense) but in the "thing" creation page I only get to specify one child id. Then my multi sensors/value nodes would need to be define in multiple things? As I can't properly define channels for each child id, and I'm not sure what var1-5 are all about.
I'll try defining things/channels/items directly in files in the following days, because so far I couldn't enjoy most of the benefits of this new version (auto discovery, logical grouping of physical device in "things", questionable "do-it-all in paper ui"), and I'm almost considering using mqtt1 binding in the new install