π¦οΈ ESPHome Solar Weather Station (ESP32 + BME280 + Deep Sleep)
This project is a low-power, solar-powered weather station built with an ESP32 (NodeMCU-32S) and a BME280 sensor for measuring temperature, humidity, and air pressure.
It is designed for maximum energy efficiency using a dynamic deep sleep algorithm based on the measured solar voltage and is fully integrated into Home Assistant via ESPHome.
Perfect for outdoor and off-grid applications.
π§ Features
β Temperature, humidity, and pressure measurement (BME280) β Dew point and altitude calculation β Solar and battery voltage monitoring β Dynamic deep sleep based on solar input β Battery level in % with status text β Min/Max temperature and humidity tracking (daily reset) β Deep sleep control via Home Assistant β WiFi RSSI quality + system status β Last update timestamp β OTA updates β Static IP + fallback hotspot β Optimized for solar / battery usage
π§ Dynamic Deep Sleep Logic
Sleep duration is automatically adjusted based on solar voltage:
Solar Voltage Sleep Time
4.5 V 20 minutes 2.5 V 35 minutes 1.0 V 45 minutes β€ 1.0 V 70 minutes
Deep sleep can also be manually enabled/disabled using the Home Assistant entity:
input_boolean.wetterstation_deep_sleep
π Power System
Battery voltage reading via ADC + voltage divider (R1 / R2)
Percentage calculation based on 3.2 V β 4.2 V
Text status: Full / OK / Low / Critical
Solar voltage is used to control sleep cycle duration
π¦ Hardware
ESP32 NodeMCU-32S
BME280 (I2C address: 0x76)
Li-Ion battery
Solar panel
Voltage divider (R1 = 97kΞ©, R2 = 26.8kΞ© β adjustable)
Outdoor enclosure (recommended)
π Home Assistant Integration
The station exposes the following main entities:
Temperature, humidity, pressure
Dew point & altitude
Min/Max (temperature and humidity)
Battery percentage
Solar voltage
Wake-ups per day
Last update
Sleep mode state
WiFi signal quality
Connected via ESPHome API (encrypted).
π Configuration Overview
Platform: ESP32 (nodemcu-32s)
Framework: Arduino
BME280 via IΒ²C (SDA 21 / SCL 22)
ADC:
GPIO34 β Battery
GPIO35 β Solar
Dynamic deep sleep control via scripts
π Planned Extensions