Skip to content

Testing with Home Assistant

Matěj 'Horm' Horák edited this page Feb 3, 2024 · 3 revisions

This guide will help you set up a test of the airthings-ble integration in a local Home Assistant environment.

Setup

Make sure you have the HA core repository installed and your branches are up-to-date. The folder structure should look like this:

home-assistant
|-- airthings-ble
|-- core

Install and start the test environment with the latest code:

cd core
bash script/setup # Setup core dependencies
source venv/bin/activate # Activate the virtual environment

# Install airthings-ble and start HA with the airthings-ble integration
cd ../airthings-ble && poetry install && cd ../core/ && hass -c config --skip-pip-packages airthings-ble 

You might be asked for Bluetooth permissions, accept it otherwise the integration will not work. If everything is set up correctly, you should be able to access Home Assistant at localhost:8123.

In case of code changes, you can restart Home Assistant with the following command:

hass -c config --skip-pip-packages airthings-ble

Testing

Here are a couple of things you can do to test the integration:

  1. Remember to have a device nearby using Bluetooth (devices using the Airthings Smartlink will not work)
  2. Go to the integration page
  3. You should see a suggestion to add the Airthings integration (if not, you can add it manually)
  4. Follow the instructions to add the integration
  5. Compare the values with the app or web interface
Clone this wiki locally