sensor-lora

Home Assistant LoRa-connected sensor firmware for an ESP32.

dashboard

OK. It’s pretty niche. But if you happen to have, say, a greenhouse that is beyond packet-radio transmission distance for a battery powered temperature sensor, here’s arduino firmware for an ESP32 providing Home Assistant sensor data over a LoRa link.

Yes. You can now check your greenhouse temperature from 5 kilometers away. Handy!

Drivers for a VEM7700 light sensor, Sensirion SHT31 temperature and humidity sensor, and the device’s battery voltage are provided. The firmware’s plugin architecture makes it easily extensible to provide new sensors.

How to use this

You’ll need platformio, a LILYGO T3 V2.1.6 LoRa32 microcontroller, some sensors, a The Things Network, a LoRaWAN hub, and a Home Assistant installation.

Step one. Create a The Things Network project and get its authentication details. Set those in platformio.ini build flags. Flash the micocontroller. Install the Node-RED flow with the protocol buffer schema. Wire up an MQTT in node for The Things Network, and an MQTT out node for Home Assistant’s MQTT server.

Step two. Boom. The entities appear in Home Assistant.

cartoon

OK. Full(er) documentation here.

Contributions

…are welcome. The C++ code is functional, but not optimal. The drivers for new sensors are easy to write. I’d like to figure out how to implement sleep to extend battery life.

Licensing

It’s licensed under the MIT License – see file LICENSE.md for details.

Credits

The LoRa library uses Francois Riotte’s library TheThingsNetwork_esp32.

Contact

You can contact me at [email protected]

GitHub

View Github