RuuviTag Discovery: web interface to see and send measures (MQTT, databases, Home Assistant)

Hi @ARosti

Youā€™re right, pressure should be in hPa, not in Pa. It should be fixed in release 0.2.7 :wink:

1 Like

Accuracy should be properly handled in release 0.2.7, so you can change amount of decimals by creating a new custom measure (for now, accuracy canā€™t be change on default measures ā€¦ can change in futur :slight_smile: )

1 Like

I have homeassistant installed in raspberry. Now trying to install RuuviTag Discovery and got this error: ā€œThe command ā€˜/bin/ash -o pipefail -c npm install --no-audit --productionā€™ returned a non-zero code: 1ā€.

What is wrong with this?

Hi @ml
I just tried a fresh install and I did not encounter any problem.
How did you install RuuviTag Discovery? Following https://github.com/balda/ruuvitag-discovery/blob/master/DOCS.md instructions?
And can you give me your raspberry model? and which version of Home Assistant you are using?
Thanks

Tested and working well. Still easy to understand and use also :grinning: Now I just need to start using these new labels in Home Assistant so it will be much cleaner.

1 Like

Oh dear! Something seems to be wrong on the latest 0.2.8 version. I tried to upgrade my Raspbian installation and I thought I must have done something silly so I ended up installing ubuntu server since that was something I planned to do at some point anyway. But even after clean install I ended up getting same kind of problems that seem to be related to dependencies. Especially node-gyp gives errors. What could be the reason?

Error log:

0 info it worked if it ends with ok
1 verbose cli [ ā€˜/usr/bin/nodeā€™, ā€˜/usr/bin/npmā€™, ā€˜startā€™ ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ ā€˜prestartā€™, ā€˜startā€™, ā€˜poststartā€™ ]
5 info lifecycle ruuvitag-discovery@0.2.8~prestart: ruuvitag-discovery@0.2.8
6 info lifecycle ruuvitag-discovery@0.2.8~start: ruuvitag-discovery@0.2.8
7 verbose lifecycle ruuvitag-discovery@0.2.8~start: unsafe-perm in lifecycle true
8 verbose lifecycle ruuvitag-discovery@0.2.8~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ubuntu/ruuvitag-discovery/node_modules/.bin:/usr/local/sbin>
9 verbose lifecycle ruuvitag-discovery@0.2.8~start: CWD: /home/ubuntu/ruuvitag-discovery
10 silly lifecycle ruuvitag-discovery@0.2.8~start: Args: [ ā€˜-cā€™, ā€˜NODE_ENV=production node index.jsā€™ ]
11 silly lifecycle ruuvitag-discovery@0.2.8~start: Returned: code: 1 signal: null
12 info lifecycle ruuvitag-discovery@0.2.8~start: Failed to exec start script
13 verbose stack Error: ruuvitag-discovery@0.2.8 start: NODE_ENV=production node index.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ruuvitag-discovery@0.2.8
15 verbose cwd /home/ubuntu/ruuvitag-discovery
16 verbose Linux 5.4.0-1028-raspi
17 verbose argv ā€œ/usr/bin/nodeā€ ā€œ/usr/bin/npmā€ ā€œstartā€
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error ruuvitag-discovery@0.2.8 start: NODE_ENV=production node index.js
22 error Exit status 1
23 error Failed at the ruuvitag-discovery@0.2.8 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I was able to solve this myself. I ended up installing Raspberry Pi OS back because with Ubuntu I couldnā€™t even get the bluetooth adapter working. After playing with countless of versions of Node.js and npm and dependencies I ended up in combination that would start up. I tried to keep track what Iā€™m doing so I would be able to write exact steps here incase someone else has the same problem but I lost track. Gained some good troubleshooting experience and learned not to mess with working system :wink:

1 Like

What I might be doing wrong here as I seem to have some issue sending the messages to MQTT broker (if I have understood correctly how MQTT works)?

In the RuuviTag Discovery I have a total of three devices recognized. For one of these devices I have set a target to be HiveMQ.

In the log file it says that it is sending information to the configured target (Hive_MQTT):

[2021-06-01T21:31:15.684Z] [DEBUG] Broadcast to "Hive_MQTT"
[2021-06-01T21:31:15.686Z] [DEBUG] [MQTT] Publish on topic "Work/ruuvitag_d8b98aa8acac" message: {"id":"d8b98aa8acac","name":"RuuviTag d8b98aa8acac","field":"ruuvitag_d8b98aa8acac","measures":[{"label":"Temperature","field":"temperature","value":22.09,"measure":"temperature"}]}

But for some reason the message never gets there. I have manually opened a subscription to this topic and tested from Home Assistant to send a ā€œHelloā€ which I then received in the subscription end. But I canā€™t get the messages showing in the terminal that are sent by these RuuviTags. Also Home Assistant doesnā€™t show these tags.

pi@raspberrypi:/home/ruuvitag-discovery/data $ mqtt sub -h XXX.s2.eu.hivemq.cloud -p 8883 -s -u XXX -pw -t 'Work/ruuvitag_d8b98aa8acac'
Enter value for --password (The password for authentication):
Hello

I have installed Rassbian OS to the Raspberry Pi 4 and then manually installed Home Assistant with virtual environment.

Br,
Jussi

Ended up installing Mosquitto and got this working with it. Didnā€™t know how to extract information from the JSON message (tag) so ended up creating topics for each field for every tag in the Home Assistant. I also created custom fields for rounding humidity percentage and this displayed correctly in the RuuviTag Discovery but it still sent information without rounding.

New to HomeAssistant and this works like a charm! I had tiny problems with installation but this was due to my low knowledge about home assistant. Have to study how to utilize this in node-red/ha.

Thanks a lot!

1 Like

Article published about the Home Assistant and RuuviTags. Unfortunately not yet direct support for the Ruuvi gateway and HASS. https://ruuvi.com/connecting-ruuvitag-bluetooth-sensors-to-home-assistant/