Skip to main content

Sensors

Overview

The TBox automatically publishes all configured sensor values to the MQTT broker.

Each sensor is represented as a Home Assistant sensor entity using MQTT Discovery. The published entity configuration depends on the configured sensor type, sensor function and Home Assistant device class.

Topic Structure

All sensor topics follow the same structure:

homeassistant/sensor/<device>/<identifier>/<type>

Example:

homeassistant/sensor/tboxAABBCCDDEEFF/temperature/state
homeassistant/sensor/tboxAABBCCDDEEFF/temperature/config

Discovery Topics

Each sensor publishes one retained discovery message.

homeassistant/sensor/<device>/<identifier>/config

The discovery message contains all information required by Home Assistant to create the entity automatically.

State Topics

Current sensor values are published to:

homeassistant/sensor/<device>/<identifier>/state

Example:

homeassistant/sensor/tboxAABBCCDDEEFF/onewire01_temperature/state

Published Sensor Types

The following sensor categories are currently supported.

CategoryExamples
TemperatureNTC, DS18B20, BME280, BME680, SHTx, MLX90614
HumidityBME280, BME680, SHTx
PressureBME280, BME680, SHTx
Dew PointBME280, BME680, SHTx
Air QualityBME680
CO₂MH-Z19B
IlluminanceBH1750
pHAnalog pH Sensor
Water LevelAnalog Level Sensor
EnergyHLW8032
PowerHLW8032
CurrentHLW8032
VoltageHLW8032

Home Assistant Device Classes

The published MQTT entities use the appropriate Home Assistant device class.

Device ClassUnit
temperature°C
humidity%
pressurehPa
illuminancelx
carbon_dioxideppm
energykWh
powerW
currentA
voltageV
volumel
phpH

Units of Measurement

The firmware automatically assigns the correct engineering unit.

MeasurementUnit
Temperature°C
Humidity%
PressurehPa
Dew Point°C
CO₂ppm
Illuminancelx
PowerW
EnergykWh
CurrentA
VoltageV
Water Levell
pHpH

Discovery Information

Each sensor publishes the following information:

  • Entity name
  • Object ID
  • Unique ID
  • State topic
  • Device class
  • Unit of measurement
  • State class
  • Manufacturer
  • Device model
  • Hardware version
  • Firmware version

Update Behaviour

Sensor values are published automatically whenever the internal process values are updated.

Typical examples include:

  • Temperature changes
  • Power measurement updates
  • Energy counter updates
  • Water level changes
  • pH measurements
  • CO₂ measurements

Example Topics

Temperature sensor:

homeassistant/sensor/tboxAABBCCDDEEFF/temperature/state

Power measurement:

homeassistant/sensor/tboxAABBCCDDEEFF/power/state

Energy counter:

homeassistant/sensor/tboxAABBCCDDEEFF/energy/state

Water level:

homeassistant/sensor/tboxAABBCCDDEEFF/tank_level/state

Example Payloads

Temperature:

23.7

Humidity:

58.4

Power:

146.2

Energy:

12.543

Water level:

87

pH:

6.42

Naming Convention

Sensor entity names are generated from the configured hardware number and sensor function.

Example:

OneWire 01 Temperature

becomes

onewire01_temperature

This guarantees unique MQTT topics and Home Assistant entity identifiers for every sensor.