Support for ruuvi tags in Home assistant (HASS.io)

So, Ruuvi worked quite well with Home Assistant and raspberry pi ( with this library ) if you installed Home Assistant directly on your pi.

However, Home Assistant has been going in the direction of containers architecture managed by supervisor - they call it HASS.io. This architecture makes it really easy to install and do OTA updates and improves stability a lot. The downside is that HASS.io runs in pre-setup containers that are compiled and optimized for various architectures, so installing additional requirements is really hard. One alternative is to create an add-on ( like this one, but those can be quite heavy )

Python3 added support for native Bluetooth sockets, and although the adoption has been slow, it is possible to build bluetooth applications purely on python, for example with bleson library – https://github.com/TheCellule/python-bleson

What I’ve done

  1. Added support for native Python sockets in Home assistant – https://github.com/home-assistant/docker-base/pull/53

  2. Forked and simplified https://github.com/ttu/ruuvitag-sensor library with - https://github.com/ruuvi-friends/simple-ruuvitag . This lib uses only bleson, and might be in the future compatible with MacOS and Windows since bleson is aiming for cross platform (note that there’s work on the original lib in the same direction to use bleson)

  3. Forked and changed https://github.com/JonasR-/ruuvi_hass to increase stability and use the new library – https://github.com/ruuvi-friends/hass-ruuvi

Result

PS: I’ve been playing around a bit with Ruuvi, so I created an github org: Ruuvi friends for all my projects. I noticed that some libraries can become quite abandoned, with no replies from authors for months, so if we get together maybe maintaining OSS around ruuvi would become easier? Get in touch if you would like to jump in :slight_smile:

PPS: I added the same support for Bluetooth sockets in the official Python docker image: https://github.com/docker-library/python/pull/445

Simple Ruuvitag will work inside the python official container image if you allow the docker to access your host network with --net=host but will depend greatly if docker can access your bluetooth devices or not :+1: Here be dragons :dragon:

1 Like

On a side note, Ruuvi logos are being used as googly eyes on the raspberry pi that is running the HASS.io

4 Likes

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/