From b026f2937a9b39da34db02b6180a8fd79f531947 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Thu, 19 Feb 2026 20:04:19 -0500 Subject: [PATCH] Refactor battery sensor configuration to use MAX17048 with updated parameters --- esphome/ha-remote/ha-remote-1.base.yaml | 76 ++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/esphome/ha-remote/ha-remote-1.base.yaml b/esphome/ha-remote/ha-remote-1.base.yaml index 40ede50..7563206 100644 --- a/esphome/ha-remote/ha-remote-1.base.yaml +++ b/esphome/ha-remote/ha-remote-1.base.yaml @@ -133,41 +133,41 @@ font: # --- Battery fuel gauge (Adafruit MAX17048 via compatible driver) --- sensor: - # - platform: max17043 - # id: max17048_battery - # i2c_id: i2c_main - # update_interval: 120s - # battery_voltage: - # name: "Remote Battery Voltage" - # id: remote_battery_voltage - # entity_category: diagnostic - # device_class: voltage - # state_class: measurement - # accuracy_decimals: 3 - # on_value: - # then: - # - lambda: |- - # ESP_LOGI("battery", "Voltage: %.3f V", x); - # battery_level: - # name: "Remote Battery Level" - # id: remote_battery_level - # entity_category: diagnostic - # device_class: battery - # state_class: measurement - # accuracy_decimals: 0 - # on_value: - # then: - # - lambda: |- - # const float pct = x; - # ESP_LOGI("battery", "Level: %.0f%%", pct); - - platform: custom - lambda: |- - auto max17048_sensor = new MAX17048Sensor(); - App.register_component(max17048_sensor); - return {max17048_sensor->voltage_sensor, max17048_sensor->percentage_sensor}; - sensors: - - name: "Voltage" - unit_of_measurement: V - accuracy_decimals: 2 - - name: "Percentage" - unit_of_measurement: '%' + - platform: max17043 + id: max17048_battery + i2c_id: i2c_main + update_interval: 120s + battery_voltage: + name: "Remote Battery Voltage" + id: remote_battery_voltage + entity_category: diagnostic + device_class: voltage + state_class: measurement + accuracy_decimals: 3 + on_value: + then: + - lambda: |- + ESP_LOGI("battery", "Voltage: %.3f V", x); + battery_level: + name: "Remote Battery Level" + id: remote_battery_level + entity_category: diagnostic + device_class: battery + state_class: measurement + accuracy_decimals: 0 + on_value: + then: + - lambda: |- + const float pct = x; + ESP_LOGI("battery", "Level: %.0f%%", pct); + # - platform: custom + # lambda: |- + # auto max17048_sensor = new MAX17048Sensor(); + # App.register_component(max17048_sensor); + # return {max17048_sensor->voltage_sensor, max17048_sensor->percentage_sensor}; + # sensors: + # - name: "Voltage" + # unit_of_measurement: V + # accuracy_decimals: 2 + # - name: "Percentage" + # unit_of_measurement: '%'