Hass.IO and ble beacon (Ruuvitag)


I’m quite new to Home Assistant/Raspberry (done lot of industrial automation and PLC programming in real life), but little bit confused about Hassbian vs Hass.IO. I’ve been trying to find information that is there any possibility to use Ruuvitag BLE beacons with Hass.IO or is it more stripped/limited than Hasbian?

I’ve seen few example codes how to use Ruuvitag in HA, but it wasn’t that clear is it possible to do with HASS.IO image downloaded from Home Assistant web page. If it is is there someone who could explain how to do this, because most of these things are different in HASS.IO?

I wouldn’t want to use Hassbian anymore if it is not the future of Home Assistant.


There used to be problems with BLE monitoring on Pi, but maybe that has been resolved. I use std BT for presence detection with HassIO and it is pretty flawless.

Hassio doesn’t let you install additional libraries (pip), but you can add custom components just like you would in Hassbian.

I’m also interested in to know how to set up Ruuvitag to Home Assistant at Hass.IO.
Has anyone updated instructions to this?

For examble what are requirements for this:

The instructions have you copy the files to the custom_components directory. You can create this on your Hassio system in the /config directory.

I copied the files to the /config/custom_components/ directory and edited configuration.yaml file.
Sensors are now visible at the overview but state is unknown. I’m still missing something?

Error on polling sensors
Traceback (most recent call last):
  File "/config/custom_components/ruuvi-hass/sensor.py", line 88, in poll
    self.conditions = self.RuuviTagSensor.get_data_for_sensors(self.mac_addresses, self.timeout)
  File "/usr/local/lib/python3.7/site-packages/ruuvitag_sensor/ruuvi.py", line 93, in get_data_for_sensors
    for new_data in RuuviTagSensor._get_ruuvitag_datas(macs, search_duratio_sec, bt_device=bt_device):
  File "/usr/local/lib/python3.7/site-packages/ruuvitag_sensor/ruuvi.py", line 134, in _get_ruuvitag_datas
    for ble_data in data_iter:
  File "/usr/local/lib/python3.7/site-packages/ruuvitag_sensor/ble_communication.py", line 110, in get_datas
    procs = BleCommunicationNix.start(bt_device)
  File "/usr/local/lib/python3.7/site-packages/ruuvitag_sensor/ble_communication.py", line 76, in start
  File "/usr/local/lib/python3.7/_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: 1

Did you figure this out…?

Not yet. I think python library is missing and i’m not sure how to install it to hassio. Or it is even possible?

It seems that ruuvi_hass requires ruuvitag-sensor in order to operate. But it is possible to install that on a Hass.io based installation? I wonder that also.

I have been going through the same issues. I tried to install ruuvi-hass but then came up with the challenge of pip3 and python3 not being in the container (and not being able to install them)

Then I tried the hass-ruuvitag which looked a bit more up to date, but have no idea how to get it to work. I managed to clone it into the addons directory, and modify the json file, and then what ? :smiley: I also tried to add it through the addons page in the UI and that didn’t take it either … damn … I was really hoping for the readouts from my ruuvi tags. Any ideas what to do next ?

I managed to get my Ruuvitags working with Home assistant, alltough it was not as straightforward as I would have liked. Here are the steps:

  1. Do not use standard Hass.io installer. Get an another operating system. (I used Raspbian)
  2. Install Docker.
  3. Install Home Assistant with hassio-installer inside Docker. That way you can install and run Python and Pip.
  4. Install Python3 and Pip3 outside the Hassio container in Docker.
  5. Install ruuvitag-sensor according to it’s instructions using pip.
  6. Make a custom python script which reads the Ruuvitag data and writes it to a file. (Sample file below)
  7. Add sensor to Home Assistant, which reads the data from file (Sample below)
  8. Run that python script inside Screen.

Custom Python script:

from ruuvitag_sensor.ruuvi import RuuviTagSensor
import json

def handle_data(found_data):
    # Change data to JSON format and write to file
    with open("/usr/share/hassio/homeassistant/custom_components/ruuvitag-sensor/tag2.json", "w") as fp:
        json.dump(found_data[1], fp)

# Read only a single Ruuvitag. 
# Mac can easily be obtained with Ruuvitag mobile application.

# This line causes the process to run untill terminated.
RuuviTagSensor.get_datas(handle_data, mac)

Custom sensors to Home Assistant, in sensor.yaml:

- platform: file
  name: outside_temperature
  file_path: custom_components/ruuvitag-sensor/tag2.json
  value_template: '{{ value_json.temperature }}'
  unit_of_measurement: "°C"
  scan_interval: 1

- platform: file
  name: outside_humidity
  file_path: custom_components/ruuvitag-sensor/tag2.json
  value_template: '{{ value_json.humidity }}'
  unit_of_measurement: "%"
  scan_interval: 1

- platform: file
  name: outside_pressure
  file_path: custom_components/ruuvitag-sensor/tag2.json
  value_template: '{{ value_json.pressure }}'
  unit_of_measurement: "hPa"
  scan_interval: 1

The process seems quite lenghty and complicated at first, but actually isn’t so bad. The main annoyance is reinstalling Home Assistant to run inside Docker. Be sure to back up all your configuration files. With that, there is a minimal need for reconfiguring.

Also, you can get acceleration data with adding similar sensors. I just didn’t see a point doing that. (After all, if my wall starts to move, I have bigger problems than monitoring the acceleration.)

There’s add-on for hass.io. You just have to install it as local add-on. Working fine with the 0.102.3.

  1. download zip from github repo (clone or download)
  2. extract folder hass-ruuvitag-master to \hassio\addons\ folder
  3. in home assistant go to add-ons and hit the small refresh button on the upper right
  4. local add-ons should now be visible. go ahead and install the hass-ruuvitag addon
  5. install takes some time, be patient. after install scroll down to log and hit refresh. you should now see your ruuvitag mac address. fill the configuration section with id (mac address) and name. hit save and restart the add on. youre done!


1 Like

Can you explain how to do that extracting? For a total noob… Where/how can I find that folder?


First of all, you need to have Samba add-on installed on HA to expose \hassio\addons\ folder for Windows or whatever os you are using. Then extract the downloaded zip file to that folder. You should then have \hassio\addons\hass-ruuvitag-master\ folder structure on your hassio machine.

Thanks for help. Managed to install add-on and even somehow setup 3 tags. Seems to work just fine :slight_smile:

Yes, this is working for me also.
First I got an error because I didn’t change the “name” field(default “some-name” was incorrect).

I was trying to set up my z-wave for the first time and the same time ruuvitags stopped working. The addon seems to work just fine but sensors are missing. Tags are working. Almost seems like RPI4 ble stopped working. Everything went wrong when I put usb hub and aeotec z-stick to RPI. What to try next…?

edit. Reboot hassos and everything is working again. :slight_smile:

Hi, newbie here, I keep on getting error which says below:

tag fb82526e1965: failed 2 http://hassio/homeassistant/api/states/sensor.Ruuvi 1965_temperature: 500 Internal Server Error
Server got itself in trouble

I really don’t know how to go about this :frowning:

1 Like

Hi, I have the same problem. I’m getting similar “500 Internal Server Error”. I’m running hass.io ruuvitag addon in Home Assistant 2020.12.0

Support for Ruuvitag sensors is added in BLE monitor 3.3.2-beta, but I’m looking for someone to test.

Especially the motion sensor needs some confirmation if it is working as expected. So, if someone wants to help with some testing, please post your findings in this issue. Thanks!

Check out this Add-on TheengsGateway. It works without coding anything. Just install this Add-on and some MQTT broker like Mosquitto. Thats it!