Hello!
I have 5 esp32 working just fine with esphome.
There is an issue with the latest one, not updating the firmware when I send the service command update.install via an automation in HA.
In fact, on this device, the entity update.aaa_firmware is in the diagnostic category, which is read-only, instead of the config category like the 4 others.
I have not clue why on this specific esp32 it happens. I have always the same basic config code on all devices.
Any thoughts?
Thanks in advance.
the yaml code:
esphome:
name: ${device_name}
friendly_name: Solar Monitor
# Run script on boot to decide deep sleep timing
on_boot:
- priority: -100
then:
- script.execute: check_current
substitutions:
device_name: my-device
esp32:
board: esp32dev
framework:
type: arduino
logger:
baud_rate: 115200
level: DEBUG
api:
encryption:
key: "REDACTED" # Secure API connection key
ota:
- platform: esphome
password: "REDACTED" # OTA update password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: LIGHT # Light sleep to reduce power usage
i2c:
sda: GPIO21
scl: GPIO22
scan: true # Auto-detect I2C devices
sensor:
- platform: ina219
address: 0x40
shunt_resistance: 0.1Ω
max_voltage: 6.0V
max_current: 3.2A
update_interval: 5s
power:
name: "Power"
bus_voltage:
name: "Bus Voltage"
shunt_voltage:
name: "Shunt Voltage"
current:
name: "Current"
id: solar_current
unit_of_measurement: "A"
accuracy_decimals: 6
- platform: adc
pin: GPIO32
name: "Battery Voltage"
id: battery_voltage
unit_of_measurement: "V"
accuracy_decimals: 2
update_interval: 5s
attenuation: 11db
filters:
- multiply: 1.272 # Voltage divider calibration
- platform: wifi_signal
name: "${device_name} WiFi Signal"
update_interval: 5s
binary_sensor:
- platform: status
name: "Device Status" # Shows if ESP is online
- platform: homeassistant
id: disable_sleep
entity_id: input_boolean.disable_deep_sleep
on_release:
then:
- script.execute: check_current # Re-evaluate sleep on input change
text_sensor:
- platform: wifi_info
ip_address:
name: "${device_name} IP"
ssid:
name: "${device_name} SSID"
mac_address:
name: "${device_name} MAC"
script:
- id: check_current
mode: queued
then:
- wait_until:
condition:
api.connected:
timeout: 10s
- delay: 2s
- if:
condition:
lambda: |-
return !id(disable_sleep).state;
then:
- if:
condition:
lambda: 'return id(solar_current).state < 0.0;' # Panel current is negative (night)
then:
- deep_sleep.enter:
id: deep_sleep_control
sleep_duration: 600000ms # 10 minutes
else:
- deep_sleep.enter:
id: deep_sleep_control
sleep_duration: 60000ms # 1 minute
deep_sleep:
id: deep_sleep_control # Deep sleep controller