The Things Network


This integration only supports TTNv2 that has been definitively switched off in 2022 (deprecated). For TTNv3, use the [MQTT integration](/integrations/mqtt).

The thethingsnetwork integration allows one to interact with the The Things Network. This community-driven and open network supports LoRaWAN for long range (~5 to 15 km) communication with a low bandwidth (51 bytes/message). Gateways transfers the received data from the sensors to the The Things Network.

The Things network support various integrations to make the data available:

The Things Network Integration Home Assistant platform
MQTT
Storage thethingsnetwork
HTTP

There is currently support for the following device types within Home Assistant:

Setup

Visit the The Things Network Console website, log in with your The Things Network credentials, choose your application from Applications.

The Application ID is used to identify the scope of your data.

Application overview

You need an access key to be able to read the data from your application.

Access keys

Configuration

To enable this integration, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
thethingsnetwork:
  app_id: sensor-123
  access_key: ttn-account-v2.xxxxxxxxxxx_yyyyyyyyyyy

Configuration Variables

app_id string Required

The Application ID.

access_key string Required

The access key.

Sensor

The thethingsnetwork sensor platform allows you to get data from a The Things Network Storage Integration.

This platform requires that the The Things Network integration is set up and the The Things Network Storage Integration as well.

Prerequisites

Visit the The Things Network Console website, log in with your The Things Network credentials, choose your application from Applications and go to Integrations.

Add a new integration.

Add a The Things Network integration

Select Data Storage.

Choose a The Things Network integration

Click Add integration to finish the process.

Add a The Things Network Data Storage integration

When done, the status of the integration should be Running. You could check the output after clicking on go to platform in an interactive web interface.

Add a The Things Network integration

Select Devices to get the ID of your device that you want to use.

Devices overview

Configuration

To enable this platform, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: thethingsnetwork
    device_id: ha-demo
    values:
      current: ampere
      voltage: V

Configuration Variables

device_id string Required

The ID of the device.

values list Required

The sensor values with their unit of measurement