RuuviTag sensor for hass.io
This project leverages python3 native bluetooth sockets. For python to have access to the Bluetooth socket family it needs to have been compiled with either lib-bluetooth.h or bluez.h in your operating system.
Recent operating systems like Ubuntu and Raspian should support this when using python3. HASS.io also works after this pull request as well as the official python library after this pull request
Run bleson-setcap.sh if you have installed homeassistant to debian/similar according to default instructions. Requires sudo access!
Copy the contents of custom_components
in this repo to <config folder>/custom_components
(e.g. /home/homeassistant/.homeassistant/custom_components/
).
The configuration.yaml has to be edited like this
sensor:
- platform: ruuvi
sensors:
- mac: 'MA:CA:DD:RE:SS:00'
name: 'livingroom'
- mac: 'MA:CA:DD:RE:SS:01'
name: 'bathroom'
setup_platform
is called once per platform, so at boot time multiple blocking requests to IO will be performed,
resulting in only one of the platforms beings successfully setup.
The hass component supports passing the bluetoth adapter.
- platform: ruuvi
sensors:
- mac: 'MA:CA:DD:RE:SS:00'
name: 'livingroom'
adapter: "hci0"
Adapter defaults to the default of ble library
- rasperry pi 4 running Hassio (4 ruuvi sensors)
- (add please reach out so I'll your setup here)
This work is a mesh of multiple projects that have been refactored for use in HASS.
- Adding native python bluetooth sockets in HASS base python image - home-assistant/docker-base#53
- Refactoring and reuse of some code from https://github.com/ttu/ruuvitag-sensor to create https://github.com/sergioisidoro/simple-ruuvitag
- Refactoring the work from https://github.com/JonasR-/ruuvi_hass to support bluezson
Special thanks to
- Tomi Tuhkanen for all the work in ruuvitag-sensor lib
- peltsippi for testing
- JonasR- for his code fro