This binding allows integration of Ruuvi Tags via MQTT data, as collected by Ruuvi Gateway.
Requires OpenHAB 3.4.0-M1 or newer
Ruuvi gateway is listening for Bluetooth advertisements and publishing that data over MQTT.
Compared to Ruuvi Tag Bluetooth binding, this binding has the benefit of relying on strong and reliable antenna of Ruuvi Gateway, as opposed to e.g. usually much weaker antenna integrated onto computer motherboard.
Ruuvi Cloud Subscription is not needed at all as the integration is local.
Both RuuviTag and RuuviTag Pro are supported.
I am fairly new to openHab and installed openhabian with openHAB 4.1.2 on RaspberryPi 4. I was able to setup Moquitto MQTT Servce and setup Ruuvi Gateway to publish messages to ruuvi/# topic. I have also setup MQTT broker Thing and Ruuvi Gateway MQTT binding. I have also one Ruuvi Tab configured using the Broker as Parent Bridge.
I can see from the log that data is received by the MQTT Broker. If i enable channel on the broker I will get all messages, but the problem is that the Tag is not receiving any data and the Status will go to OFFLINE after timeout. I would greatly appreciate if someone knows what is going wrong here. Is there some communication issue or could the problem be with openHab 4.
There is the tag config:
UID: mqtt:ruuvitag_beacon:dcbdc7eb01:RuuviTag_Ulkovarasto
label: RuuviTag SmartBeacon
thingTypeUID: mqtt:ruuvitag_beacon
configuration:
topic: ruuvi/EF:91:F3:24:DE:88
bridgeUID: mqtt:broker:dcbdc7eb01
location: Ulkovarasto
channels:
- id: rssi
channelTypeUID: mqtt:ruuvitag_rssi
label: RSSI
description: Received signal strength indicator
configuration: {}
- id: ts
channelTypeUID: mqtt:ruuvitag_ts
label: Timestamp
description: Timestamp when the message from Bluetooth sensor was received by
Gateway (ts)
configuration: {}
- id: gwts
channelTypeUID: mqtt:ruuvitag_gwts
label: Relay Timestamp
description: Timestamp when the message from Bluetooth sensor was relayed by
Gateway (gwts)
configuration: {}
- id: gwmac
channelTypeUID: mqtt:ruuvitag_gwmac
label: Gateway MAC Address
description: MAC-address of Ruuvi Gateway
configuration: {}
- id: accelerationx
channelTypeUID: mqtt:ruuvitag_accelerationx
label: Acceleration X
description: null
configuration: {}
- id: accelerationy
channelTypeUID: mqtt:ruuvitag_accelerationy
label: Acceleration Y
description: null
configuration: {}
- id: accelerationz
channelTypeUID: mqtt:ruuvitag_accelerationz
label: Acceleration Z
description: null
configuration: {}
- id: batteryVoltage
channelTypeUID: mqtt:ruuvitag_batteryVoltage
label: Battery Voltage
description: null
configuration: {}
- id: dataFormat
channelTypeUID: mqtt:ruuvitag_dataFormat
label: Data Format Version
description: null
configuration: {}
- id: humidity
channelTypeUID: mqtt:ruuvitag_humidity
label: Humidity
description: null
configuration: {}
- id: measurementSequenceNumber
channelTypeUID: mqtt:ruuvitag_measurementSequenceNumber
label: Measurement Sequence Number
description: null
configuration: {}
- id: movementCounter
channelTypeUID: mqtt:ruuvitag_movementCounter
label: Movement Counter
description: null
configuration: {}
- id: pressure
channelTypeUID: mqtt:ruuvitag_pressure
label: Pressure
description: null
configuration: {}
- id: temperature
channelTypeUID: mqtt:ruuvitag_temperature
label: Temperature
description: null
configuration: {}
- id: txPower
channelTypeUID: mqtt:ruuvitag_txPower
label: TX Power
description: null
configuration: {}
Here is the log after restarting MQTT Broker:
09:38:12.730 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.ruuvigateway.internal.discovery.RuuviGatewayDiscoveryService@18eeac7 to discovery topic ruuvi/# on broker mqtt:broker:dcbdc7eb01
09:38:12.733 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.ruuvigateway.internal.discovery.RuuviGatewayDiscoveryService@a225e5 to discovery topic ruuvi/# on broker mqtt:broker:dcbdc7eb01
09:38:12.733 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@7385d9 to discovery topic +/+/$homie on broker mqtt:broker:dcbdc7eb01
09:38:12.733 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:dcbdc7eb01' changed from OFFLINE to ONLINE
09:38:12.738 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:ruuvitag_beacon:dcbdc7eb01:RuuviTag_Ulkovarasto' changed from INITIALIZING to UNKNOWN
09:38:12.740 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.espmilighthub.internal.discovery.EspMilightHubDiscoveryService@1b2bb62 to discovery topic milight/states/# on broker mqtt:broker:dcbdc7eb01
09:38:12.782 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:ruuvitag_beacon:dcbdc7eb01:RuuviTag_Ulkovarasto' changed from UNKNOWN to ONLINE: Waiting for initial data
And here is the Channel data when enabling on MQTT Broker Thing for the tag:
How did you install the mqtt addon? I just noticed that this Marketplace entry (this thread) was still “published” even though the code already got merged, and the addon is available as an official addon.If you installed this Ruuvi Gateway MQTT addon via Community marketplace, please uninstall it and install MQTT addon instead using the Web UI.
Did you configure the ruuvi thing manually? I highly suggest using discovery / thing inbox instead (see screenshot below, red INBOX button at the bottom), see docs Ruuvi Gateway MQTT - Bindings | openHAB
I suspect it possible that configured mqtt topic is slightly off (default, see below, in ruuvi gateway is ruuvi/gateway-mac/ruuvi-tag-mac). My auto-discoverd ruuvi tag looks like below (mac addresses redacted/censored)
UID: mqtt:ruuvitag_beacon:4800000000:c90000000000
label: MQTT Ruuvi Tag C9:00:00:00:00:00
thingTypeUID: mqtt:ruuvitag_beacon
configuration:
topic: ruuvi/D8:00:00:00:00:00/C9:00:00:00:00:00
bridgeUID: mqtt:broker:4800000000
channels:
- id: rssi
channelTypeUID: mqtt:ruuvitag_rssi
label: RSSI
description: Received signal strength indicator
configuration: {}
If things do not work out after checking mqtt addon installation, and utilizing thing auto-discovery, please comment here and we can troubleshoot further with logs.
as Ruuvi has recently introdudced a new product in their line called Ruuvi Air (an air quality monitor), are there any plans to add support for it to the MQTT binding? I’ve got one and am happy to be a beta tester if needed.
Nice! Hoping they are willing to do that. Also, if you need any example MQTT payloads from Gateway, I can provide those. To me they look very similar to what Ruuvi Tags send.