the YAML file was copied from your example, no changes were made to the fuel gauge. Below is the Yaml file, minus passwords and IP info.
esphome:
name: powerfeather1
friendly_name: powerfeather1
platformio_options:
board_build.flash_mode: dio
on_boot:
priority: -100.0
then:
- delay: 3s
- script.execute: consider_deep_sleep
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf
external_components:
Enable Home Assistant API
api:
encryption:
key:
ota:
- platform: esphome
password:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip:
gateway:
subnet:
dns1:
dns2:
power_save_mode: HIGH
fast_connect: true
output_power: 8.5dB
Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Powerfeather1 Fallback Hotspot"
password:
web_server:
port: 80
include_internal: true
captive_portal:
deep_sleep:
time:
- platform: homeassistant
id: ha_time
powerfeather_mainboard:
battery_capacity: 3500
battery_type: "UR18650ZY"
id: "my_powerfeather"
update_interval: 5s # applies to all types of sensor under this component
binary_sensor:
- platform: homeassistant
id: prevent_deep_sleep
name: Prevent Deep Sleep
entity_id: input_boolean.prevent_deep_sleep
internal: true
- platform: "powerfeather_mainboard"
mainboard_id: "my_powerfeather"
supply_good:
name: "Supply Good"
sensor:
platform: "powerfeather_mainboard"
mainboard_id: "my_powerfeather"
supply_voltage:
name: "Charge Voltage"
supply_current:
name: "Charge Current"
battery_voltage:
name: "Battery Voltage"
battery_current:
name: "Battery Current"
battery_charge:
name: "Battery Charge"
battery_health:
name: "Battery Health"
battery_cycles:
name: "Battery Cycles"
battery_time_left:
name: "Battery Time Left"
battery_temperature:
name: "Battery Temperature"
platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 5s
entity_category: "diagnostic"
platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi Signal Percent"
id: wifi_s
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "Signal %"
entity_category: "diagnostic"
device_class: ""
button:
- platform: "powerfeather_mainboard"
mainboard_id: "my_powerfeather"
ship_mode:
name: "Ship Mode"
shutdown:
name: "Shutdown"
powercycle:
name: "Powercycle"
number:
- platform: "powerfeather_mainboard"
mainboard_id: "my_powerfeather"
supply_maintain_voltage:
name: "Supply Maintain Voltage"
battery_charging_max_current:
name: "Battery Charging Max Current"
switch:
- platform: "powerfeather_mainboard"
mainboard_id: "my_powerfeather"
enable_3V3:
name: "Enable 3V3"
enable_VSQT:
name: "Enable VSQT"
enable_battery_temp_sense:
name: "Enable Battery Temperature Sense"
enable_battery_charging:
name: "Enable Battery Charging"
enable_battery_fuel_gauge:
name: "Enable Battery Fuel Gauge"
enable_stat:
name: "Enable STAT LED"
script:
- id: consider_deep_sleep
mode: queued
then:
- delay: 3s
- if:
condition:
binary_sensor.is_on: prevent_deep_sleep
then:
- logger.log: 'Skipping sleep, per prevent_deep_sleep'
else:
- if:
condition:
lambda: |-
auto time = id(ha_time).now();
if (!time.is_valid()) {
return false;
}
return (time.hour >19);
then:
- deep_sleep.enter:
sleep_duration: 8h
else:
- deep_sleep.enter:
sleep_duration: 180s
- script.execute: consider_deep_sleep