From d45474036c5ec15d80cb8aa6d3275174d5a95b5e Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Sun, 12 Jul 2026 13:36:54 +1200 Subject: [PATCH] Edit esp-mainpowermonitor.yaml --- esphome/esp-mainpowermonitor.yaml | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/esphome/esp-mainpowermonitor.yaml b/esphome/esp-mainpowermonitor.yaml index 1d1e24a..dc7c811 100644 --- a/esphome/esp-mainpowermonitor.yaml +++ b/esphome/esp-mainpowermonitor.yaml @@ -6,6 +6,11 @@ # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-mainpowermonitor.yaml #:########################################################################################:# # VERSIONS: +# v1.4 2026-07-12 Added Home Assistant Energy Dashboard metadata. +# Marked cumulative PZEM, mains total, and 32A Wallcharger total energy +# sensors as energy / total_increasing. +# Marked mains and EV power sensors as power / measurement. +# Added single-process compilation limit to reduce Builder memory use. # v1.3 2026-02-25 Updated yaml to zorruno layout V1.1 # v1.2 2026-02-25 Updated yaml to zorruno layout V1.1. Added EV charging binary sensor # and EV power rolling average (default 5 min). Clarified EV pulse notes. @@ -21,6 +26,11 @@ # OPERATION NOTES: # - Power Monitor using 3x PZEM-004T V3 (Modbus) for 3-phase monitoring # - Pulse input energy monitoring for 32A EV Charger (2 Wh per pulse) +# - 32A Wallcharger Total Energy is cumulative pulse-derived energy in kWh +# - Cumulative active-energy sensors are exposed to Home Assistant with: +# device_class: energy +# state_class: total_increasing +# - This allows the cumulative totals to be selected in the HA Energy Dashboard # - Adds a 5 minute rolling average for EV power to avoid spiky readings at low loads # - Adds a binary sensor to indicate when the EV charger is operating (threshold configurable) # @@ -60,7 +70,7 @@ substitutions: # Project Naming project_name: "Wemos.D1Mini PZEM-004T V3 3-Phase Power Monitor" - project_version: "v1.3" + project_version: "v1.4" # Passwords api_key: !secret esp-api_key @@ -202,6 +212,10 @@ esphome: friendly_name: "${friendly_name}" comment: "${description_comment}" area: "${device_area}" + + # Restrict PlatformIO to one simultaneous compiler process to reduce host RAM use. + compile_process_limit: 1 + project: name: "${project_name}" version: "${project_version}" @@ -467,11 +481,16 @@ sensor: power: name: "${pzem_red_p_name}" id: pzem_red_power_w + unit_of_measurement: "W" + device_class: power + state_class: measurement accuracy_decimals: 0 energy: name: "${pzem_red_e_name}" id: pzem_red_energy_kwh unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing accuracy_decimals: 3 filters: - multiply: 0.001 @@ -537,11 +556,16 @@ sensor: power: name: "${pzem_yellow_p_name}" id: pzem_yellow_power_w + unit_of_measurement: "W" + device_class: power + state_class: measurement accuracy_decimals: 0 energy: name: "${pzem_yellow_e_name}" id: pzem_yellow_energy_kwh unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing accuracy_decimals: 3 filters: - multiply: 0.001 @@ -607,11 +631,16 @@ sensor: power: name: "${pzem_blue_p_name}" id: pzem_blue_power_w + unit_of_measurement: "W" + device_class: power + state_class: measurement accuracy_decimals: 0 energy: name: "${pzem_blue_e_name}" id: pzem_blue_energy_kwh unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing accuracy_decimals: 3 filters: - multiply: 0.001 @@ -665,6 +694,8 @@ sensor: name: "${mains_total_p_name}" id: mains_total_active_power_w unit_of_measurement: "W" + device_class: power + state_class: measurement accuracy_decimals: 0 update_interval: ${pzem_update_interval} lambda: |- @@ -711,6 +742,8 @@ sensor: name: "${mains_total_e_name}" id: mains_total_active_energy_kwh unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing accuracy_decimals: 3 update_interval: ${pzem_update_interval} lambda: |- @@ -957,6 +990,8 @@ sensor: name: "${ev_power_name}" id: ev_power_avg_w unit_of_measurement: "W" + device_class: power + state_class: measurement accuracy_decimals: 0 update_interval: "${ev_power_avg_sample_interval}" lambda: |- @@ -966,6 +1001,8 @@ sensor: name: "${ev_total_energy_name}" id: ev_total_energy_kwh unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing accuracy_decimals: 3 update_interval: 10s lambda: |-