Skip to content

ESP32 BLE client for XIaomi Mi Flora Plant sensors

Notifications You must be signed in to change notification settings

slawomirksiazek/ESP32_MiFlora_MQTT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ESP32_MiFlora_MQTT

Arduino sketch - ESP32 BLE client for XIaomi Mi Flora Plant sensors. ESP32 can be powered with LiPo battery and battery level is read from ADC pin. ESP32 battery level and Mi Flora sensor measurements are pushed to the MQTT server.

Hardware & Software used

Setup

  1. Edit settings in config.h:
  • FLORA_DEVICES - MAC address(es) of your Xiaomi Mi Plant sensor(s)
  • SLEEP_DURATION - sleep duration between sensor reads
  • EMERGENCY_HIBERNATE - emergency hibernate countdown when something gets stuck
  • BATTERY_INTERVAL - Mi Flora battery status read interval
  • RETRY - device retry count when something fails
  • WIFI_SSID - WLAN SSID
  • WIFI_PASSWORD - WLAN password
  • ADC_Pin - ESP32 ADC pin number where the Battery is connected to
  • MQTT Server settings
  1. Open sketch in Arduino, compile & upload.

  2. esp_miflora.yaml - Example MQTT sensor config for Home Assistant (replace MAC addresses in the file for your MiFlora & ESP32)

Credits

About

ESP32 BLE client for XIaomi Mi Flora Plant sensors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 91.2%
  • C 8.8%