How it fits together
One usermod owns the bus. Everything else either feeds it or reads from it. No provider ever talks to MQTT, JSON or HA directly, and no consumer ever needs to know which physical chip a reading came from.
Providers
Read one piece of hardware (an I2C chip, a GPIO pin, and so on) and push readings into the hub.
Sensor Hub
Owns MQTT/HA discovery, the JSON API and the Info tab, with sensors registering at compile time and attaching at runtime. No fixed limit.
Sensor Hub
Exposes readings by name (getValueByName()) or by quantity (getValue(type)).
Consumers
Read the hub and drive an effect, a color, or brightness, either through a bespoke effect or a generic live binding.
The Hub
sensor-hub
Compile-time sensor slot registration with no fixed sensor limit, an open string-identified measurement type system, MQTT and Home Assistant discovery, the JSON API, and Info tab display with per-quantity unit conversion.
Sensor Providers
Each provider owns exactly one piece of hardware and knows nothing about MQTT, JSON or Home Assistant. That's the hub's job. Tick any you're using to add them to the config builder below.
Temperature & Humidity
Bosch BME280: temperature, humidity, pressure.
Sensirion SHTC3: temperature, humidity.
Silicon Labs Si7021: temperature, humidity.
Aosong AHT10/AHT20: temperature, humidity.
DHT11 / DHT22 (AM2302): temperature, humidity.
Dallas/Maxim 1-Wire probe: temperature only.
The ESP32's own built-in die temperature sensor. No extra hardware.
Air Quality
Sensirion SCD4x: true NDIR co2 (ppm), plus temperature/humidity.
Bosch BME680/BME688: temperature, humidity, pressure, plus raw gas_resistance.
Light & Color
Motion & Presence
Distance & Ranging
Orientation & Motion (IMU)
Electrical
Soil & Environment
Capacitive probe: calibrated 0-100% moisture level.
Generic I/O
4 independent digital pins: reed switches, float switches, dry contacts.
Consumer Usermods
These don't provide sensors. They read the hub and drive WLED itself. Tick any you're using to add them to the config builder below.
Adds a new WLED effect, “Accel Tilt”: a particle-system box that tilts with a real accelerometer reading, instead of a canned animation.
Binds live sensor readings to any existing effect's speed/intensity/custom sliders, brightness, color or checkboxes, generically, with no bespoke effect required.
Build your config
Tick whatever you're using above (or use the buttons below), then copy the generated
custom_usermods block straight into your platformio_override.ini.
Links point at each usermod's published repo, so PlatformIO fetches everything automatically.
No local cloning required.
custom_usermods =
${env:esp32dev.custom_usermods}
# tick sensors and consumers above to build your config
Getting started
- Tick your hardware and any consumer usermods above, then copy the generated config from Build your config.
- Paste it into
platformio_override.ini, in the environment you build:
[env:esp32dev]
extends = env:esp32dev
custom_usermods =
${env:esp32dev.custom_usermods}
https://github.com/lost-hope/sensor-hub.git
https://github.com/lost-hope/sensor-hub-bme280-provider.git
- Build and flash. Configure each provider's pins/I2C in its own Settings page. Sensors appear in MQTT, the Info tab and
/json/stateautomatically once attached.
Full wiring, settings and MQTT/HA discovery details are documented in each repo's own readme. Start with sensor-hub.