All Projects → ruuvi-friends → ruuvi-hass.io

ruuvi-friends / ruuvi-hass.io

Licence: MIT license
Ruuvi tag BLE sensor for Home Assistant.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ruuvi-hass.io

charger-card
A lovelace card for electrical vehicle (EV) home chargers and charging robots.
Stars: ✭ 57 (+62.86%)
Mutual labels:  hass, hacs
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-14.29%)
Mutual labels:  hass, hacs
purifier-card
Air Purifier card for Home Assistant Lovelace UI
Stars: ✭ 155 (+342.86%)
Mutual labels:  hass, hacs
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (+317.14%)
Mutual labels:  hass, hacs
ledfxrm
Custom Integration for Home Assistant to control a any (local/remote) LedFX-server - State: beta
Stars: ✭ 31 (-11.43%)
Mutual labels:  hass, hacs
HASS.Agent
Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.
Stars: ✭ 590 (+1585.71%)
Mutual labels:  hass, hacs
panasonic smart app
Panasonic Smart App integration for Home Assistant.
Stars: ✭ 22 (-37.14%)
Mutual labels:  hass, hacs
home assistant tractive
Custom component for Tractive
Stars: ✭ 34 (-2.86%)
Mutual labels:  hacs
hass-amplifi
A home assistant integration for Ubiquiti Amplifi
Stars: ✭ 17 (-51.43%)
Mutual labels:  hacs
ha-multiscrape
Home Assistant custom component for scraping (html, xml or json) multiple values (from a single HTTP request) with a separate sensor/attribute for each value. Support for (login) form-submit functionality.
Stars: ✭ 103 (+194.29%)
Mutual labels:  hacs
ruuvidriver
Serves your Ruuvitag Weather Station data over HTTP.
Stars: ✭ 13 (-62.86%)
Mutual labels:  ruuvitag
ha-iaquk
Indoor Air Quality Sensor Component for Home Assistant
Stars: ✭ 57 (+62.86%)
Mutual labels:  hacs
Home-Assistant-Sensor-Afvalbeheer
Provides Home Assistant sensors for multiple Dutch and Belgium waste collectors
Stars: ✭ 157 (+348.57%)
Mutual labels:  hacs
ad-automoli
💡 Fully automatic light management based on conditions like motion, illuminance, humidity, and other clever features
Stars: ✭ 99 (+182.86%)
Mutual labels:  hacs
hifiberry
This is a custom component to allow control of HifiberryOS devices in Home Assistant using the audiocontrol2 REST API.
Stars: ✭ 26 (-25.71%)
Mutual labels:  hacs
hass-truenas
TrueNAS integration for Home Assistant
Stars: ✭ 33 (-5.71%)
Mutual labels:  hacs
Colorfulclouds-weather
用于HASS的彩云天气组件
Stars: ✭ 57 (+62.86%)
Mutual labels:  hass
uptime-card
Minimalistic uptime card for Home Assistant Lovelace UI
Stars: ✭ 152 (+334.29%)
Mutual labels:  hacs
lovelace-valetudo-map-card
Draws the map available from a Xiaomi Vacuum cleaner flashed with Valetudo in a Home Assistant Lovelace card
Stars: ✭ 149 (+325.71%)
Mutual labels:  hacs
homeassistant-homeconnect
Custom component for Home Assistant to connect appliances supporting the Home Connect standard
Stars: ✭ 120 (+242.86%)
Mutual labels:  hacs

ruuvi-HASS.io

hacs_badge Master build status codecov

HELP WANTED! - If you want to contribute, contact @sergioisidoro by email :)

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

Quickstart

Note: If you're not using HASS.io official image, please check bellow the pre-requisites before continuing.

How to get started:

  1. Copy the contents of custom_components in this repo to <config folder>/custom_components (but do not change configuration.yaml yet).
  2. Restart HA to install the custom component and all the dependencies.
  3. Add the sensors to configuration.yaml according to the instructions bellow.
  4. Restart HA again

Configuration

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'

⚠️ Important note: Do not add more than one ruuvi platform per adapter in the sensors configuration. The code in 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.

Monitoring only certain paramters

If you don't want to monitor all of variables from all of the tags, it is possible to pick which ones you want Home Assistant to save and monitor. You can do that for each sensor by passing the monitored_conditions parameter like so:

sensor:
  - platform: ruuvi
    sensors:
        - mac: 'MA:CA:DD:RE:SS:00'
          name: 'livingroom'
          monitored_conditions:
            - temperature
            - humidity
            - pressure

If you don't provide any, all of the available data will be monitored. The available conditions for monitoring are:

temperature
humidity
pressure
acceleration
acceleration_x
acceleration_y
acceleration_z
battery
movement_counter

Different bluetooth devices

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

Throttling state updates

Because we're getting data from the devices every second or so (and updating HomeAssistand database every seconds) this can greatly impact the lifespan of your SD card and storage device (eg. Raspberry pi). As a compromise, we're only updating the sensor's state every 10 seconds. Howver you can change this value by passing a value to the max_update_frequency as you please. Eg. 0 will update HomeAssistant state as soon as the new data arrives and not lose any data, 10 will discard all data recieved 10 seconds after each sensor update.

  - platform: ruuvi
    sensors:
        - mac: 'MA:CA:DD:RE:SS:00'
          name: 'livingroom'
    max_update_frequency: 5

If you really want all the data possibe, consider setting max_update_frequency to 0, and configuring recorder to only submit changes to the database less often. For example, only recording changes to the database every 10 seconds. Note that this configuration has nothing to do with this integration

recorder:
  commit_interval: 10

Non HASS.io installations

You might choose to install Homeassistant directly on your machine or through other methods other than the official HASS image. If you do so, here are some pointers to make this custom component work.

For debian or similar

Run bleson-setcap.sh if you have installed homeassistant to debian/similar according to default instructions. Requires sudo access!

Homeassistant with Virtual Environment (venv)

(https://www.home-assistant.io/docs/installation/virtualenv/)

  1. Install bleson https://github.com/TheCellule/python-bleson

  2. Give python superuser permissions so btle scans become possible

#Make sure you have setcap
sudo apt install libcap2-bin

#Activate virtual environment, make sure to use proper path according to your installation
~$> source /xx/bin/activate

#Use the python version you've built your venv with! These apply to python3 & default homeassistant venv installation paths etc
~$> which pythonX 
/srv/homeassistant/bin/python3

#Find actual executable
~$> readlink -f /srv/homeassistant/bin/python3
/usr/bin/python3.8 

#Give permissions
~$> sudo setcap cap_net_raw,cap_net_admin+eip /usr/bin/python3.8

Tested with

  • rasperry pi 4 running Hassio (4 ruuvi sensors)
  • raspberry pi 3b+ with homeassistant venv installation and 6 sensors
  • Intel NUC with homeassistant venv installation and 6 sensors
  • (add please reach out so I'll your setup here)

Contributors

This work is a mesh of multiple projects that have been refactored for use in HASS.

Big thanks to:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].