Edit esp-attobattery.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-24 22:31:36 +12:00
parent aad2988873
commit 11249d8645
+36 -37
View File
@@ -1,9 +1,9 @@
########################################################################################## ##########################################################################################
########################################################################################## ##########################################################################################
# BYD ATTO3 12V Battery Monitor # BYD ATTO3 12V Battery Monitor
# Monitoring the status of a vehicle 12V battery with # Monitoring the status of a vehicle 12V battery with
# an esp8266 (D1 Mini). It will obviously only # an esp8266 (D1 Mini). It will obviously only
# transmit when the vehicle is within wifi range. # transmit when the vehicle is within wifi range.
# Voltage is measured with a resistor voltage divider # Voltage is measured with a resistor voltage divider
# into the analogue GPIO on the esp8266. # into the analogue GPIO on the esp8266.
# https://zorruno.com/2022/vehicle-12v-battery-monitoring/ # https://zorruno.com/2022/vehicle-12v-battery-monitoring/
@@ -15,15 +15,15 @@
# If NOT using a secrets file, just replace these with the passwords etc (in quotes) # If NOT using a secrets file, just replace these with the passwords etc (in quotes)
########################################################################################## ##########################################################################################
substitutions: substitutions:
# Device Naming # Device Naming
device_name: "esp-attobattery" device_name: "esp-attobattery"
friendly_name: "Atto3 12V Battery Monitor" friendly_name: "Atto3 12V Battery Monitor"
description_comment: "Atto3 12V Battery Monitor (when home)" description_comment: "Atto3 12V Battery Monitor (when home)"
device_area: "Garage" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. device_area: "Garage" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
# Project Naming # Project Naming
project_name: "Generic ESP8266.D1 Mini" # Project Details project_name: "Generic ESP8266.D1 Mini" # Project Details
project_version: "v1.0" # Project V denotes release of yaml file, allowing checking of deployed vs latest version project_version: "v1.0" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
# Passwords & Secrets # Passwords & Secrets
api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names
@@ -43,7 +43,7 @@ substitutions:
wake_interval: "20s" wake_interval: "20s"
sleep_interval: "300s" sleep_interval: "300s"
mqtt_fail_sleep: "1h" # If MQTT is unavailable after boot wait, sleep this long mqtt_fail_sleep: "1h" # If MQTT is unavailable after boot wait, sleep this long
########################################################################################## ##########################################################################################
# PACKAGES: Included Common Packages # PACKAGES: Included Common Packages
@@ -70,16 +70,16 @@ packages:
file: common/mqtt_common.yaml file: common/mqtt_common.yaml
vars: vars:
local_device_name: "${device_name}" local_device_name: "${device_name}"
#### WEB PORTAL #### #### WEB PORTAL ####
common_webportal: !include common/webportal_common.yaml common_webportal: !include common/webportal_common.yaml
#### SNTP (Only use if you want/need accurate timeclocks) #### #### SNTP (Only use if you want/need accurate timeclocks) ####
#common_sntp: !include common/sntp_common.yaml #common_sntp: !include common/sntp_common.yaml
#### DIAGNOSTICS Sensors #### #### DIAGNOSTICS Sensors ####
diag_basic: !include common/include_basic_diag_sensors.yaml diag_basic: !include common/include_basic_diag_sensors.yaml
diag_more: !include common/include_more_diag_sensors.yaml diag_more: !include common/include_more_diag_sensors.yaml
#diag_debug: !include common/include_debug_diag_sensors.yaml #diag_debug: !include common/include_debug_diag_sensors.yaml
#diag_resetcount: !include common/include_resetcount_diag_sensors.yaml #diag_resetcount: !include common/include_resetcount_diag_sensors.yaml
@@ -112,7 +112,7 @@ esphome:
- logger.log: "MQTT unreachable after 30s -> entering FALLBACK sleep for ${mqtt_fail_sleep}." - logger.log: "MQTT unreachable after 30s -> entering FALLBACK sleep for ${mqtt_fail_sleep}."
- deep_sleep.enter: - deep_sleep.enter:
id: deep_sleep_1 id: deep_sleep_1
sleep_duration: ${mqtt_fail_sleep} # override only this cycle sleep_duration: ${mqtt_fail_sleep} # override only this cycle
else: else:
- logger.log: "MQTT connected; awaiting '${mqtt_command_topic}/deepsleep' command." - logger.log: "MQTT connected; awaiting '${mqtt_command_topic}/deepsleep' command."
@@ -120,26 +120,26 @@ esphome:
# ESP Platform and Framework # ESP Platform and Framework
# https://esphome.io/components/esp8266.html # https://esphome.io/components/esp8266.html
# https://esphome.io/components/esp32.html # https://esphome.io/components/esp32.html
########################################################################################## ##########################################################################################
esp8266: esp8266:
board: d1_mini board: d1_mini
framework: framework:
version: latest #recommended, latest or dev version: recommended # latest or dev
########################################################################################## ##########################################################################################
# ESPHome Logging Enable # ESPHome Logging Enable
# https://esphome.io/components/logger.html # https://esphome.io/components/logger.html
########################################################################################## ##########################################################################################
logger: logger:
level: "${log_level}" #INFO Level suggested, or DEBUG for testing level: "${log_level}" #INFO Level suggested, or DEBUG for testing
#baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM) #baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM)
#esp8266_store_log_strings_in_flash: false #esp8266_store_log_strings_in_flash: false
#tx_buffer_size: 64 #tx_buffer_size: 64
############################################# #############################################
# Enable Over the Air Update Capability # Enable Over the Air Update Capability
# https://esphome.io/components/ota.html?highlight=ota # https://esphome.io/components/ota.html?highlight=ota
############################################# #############################################
ota: ota:
- platform: web_server # Uncomment if you want to be able to do OTA with the web interface - platform: web_server # Uncomment if you want to be able to do OTA with the web interface
@@ -176,9 +176,9 @@ mqtt:
########################################################################################## ##########################################################################################
deep_sleep: deep_sleep:
id: deep_sleep_1 id: deep_sleep_1
run_duration: ${wake_interval} run_duration: ${wake_interval}
sleep_duration: ${sleep_interval} sleep_duration: ${sleep_interval}
########################################################################################## ##########################################################################################
# SENSOR COMPONENT # SENSOR COMPONENT
# https://esphome.io/components/sensor/ # https://esphome.io/components/sensor/
@@ -193,19 +193,19 @@ sensor:
filters: filters:
- multiply: 3.3 - multiply: 3.3
- calibrate_linear: - calibrate_linear:
- 3.11 -> 14.00 - 3.11 -> 14.00
- 3.00 -> 13.50 - 3.00 -> 13.50
- 2.89 -> 13.00 - 2.89 -> 13.00
- 2.77 -> 12.50 - 2.77 -> 12.50
- 2.67 -> 12.00 - 2.67 -> 12.00
- 2.55 -> 11.50 - 2.55 -> 11.50
- 2.45 -> 11.00 - 2.45 -> 11.00
- 2.34 -> 10.50 - 2.34 -> 10.50
- 2.22 -> 10.00 - 2.22 -> 10.00
- 2.11 -> 09.50 - 2.11 -> 09.50
- 2.00 -> 09.00 - 2.00 -> 09.00
- delta: 0.05 # publish immediately if change >= 0.05 V - delta: 0.05 # publish immediately if change >= 0.05 V
- throttle: 2s # avoid bursts if noisy - throttle: 2s # avoid bursts if noisy
on_value: on_value:
then: then:
- mqtt.publish: - mqtt.publish:
@@ -216,4 +216,3 @@ sensor:
char buf[10]; char buf[10];
snprintf(buf, sizeof(buf), "%.2f", x); snprintf(buf, sizeof(buf), "%.2f", x);
return std::string(buf); return std::string(buf);