commissioned
This commit is contained in:
@@ -12,6 +12,7 @@ Mirrors the `eg4battery/homeassistant/` pattern.
|
||||
|----------------------------|--------------------------------------------------------------|
|
||||
| `mqtt_controls.yaml` | `configuration.yaml` → `mqtt: !include lvx6048/mqtt_controls.yaml` (or merge by hand) |
|
||||
| `template_sensors.yaml` | `configuration.yaml` → `template: !include lvx6048/template_sensors.yaml` |
|
||||
| `daily_energy_package.yaml`| `configuration.yaml` → `homeassistant: packages: {lvx6048_daily_energy: !include lvx6048/daily_energy_package.yaml}` |
|
||||
| `lovelace_controls.yaml` | Raw Lovelace card config — paste into a new dashboard view |
|
||||
|
||||
The auto-discovery sensors (battery V, fault code, mode, MPPT power, …)
|
||||
@@ -103,6 +104,24 @@ mosquitto_sub -h <broker> -u mqtt -P <pass> -v \
|
||||
…then flip a select in the dashboard. Both inverters should publish
|
||||
`"Succeeded"` within ~1 s.
|
||||
|
||||
## Daily energy indicators (harvested / used today)
|
||||
|
||||
`daily_energy_package.yaml` adds two daily-resetting kWh sensors for a
|
||||
dashboard tile:
|
||||
|
||||
- `sensor.solar_harvested_today` — PV generated today, summed across both
|
||||
inverters. Sourced from each inverter's lifetime `total_pv_generated_energy`
|
||||
Wh counter via a daily `utility_meter` (the LVX6048 firmware has no
|
||||
daily-energy query, so we meter the lifetime counter instead).
|
||||
- `sensor.solar_used_today` — household load consumed today. No cumulative
|
||||
load counter exists, so `sensor.lvx6048_stack_ac_output_active_power` (W)
|
||||
is Riemann-integrated into energy and metered daily.
|
||||
|
||||
Requires `template_sensors.yaml` (for the stack load-power rollup). A ready
|
||||
two-tile Lovelace card is in the file's trailing comment. After enabling,
|
||||
the two sensors read 0 at local midnight and climb through the day; give the
|
||||
integration a few minutes to accumulate its first non-zero value.
|
||||
|
||||
## Energy / SoC dashboard wiring (optional)
|
||||
|
||||
Once both inverters' `ac_output_active_power` and the EG4 daemon's
|
||||
|
||||
88
LVX6048/homeassistant/daily_energy_package.yaml
Normal file
88
LVX6048/homeassistant/daily_energy_package.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
# Today's solar harvested + household energy used — daily-resetting kWh
|
||||
# sensors for a dashboard indicator.
|
||||
#
|
||||
# This is a Home Assistant *package* (bundles several domains in one file)
|
||||
# so the whole feature installs as one unit.
|
||||
#
|
||||
# Install:
|
||||
# 1. Copy to <config>/lvx6048/daily_energy_package.yaml
|
||||
# 2. In configuration.yaml (once), pull it in as a package:
|
||||
# homeassistant:
|
||||
# packages:
|
||||
# lvx6048_daily_energy: !include lvx6048/daily_energy_package.yaml
|
||||
# 3. Requires template_sensors.yaml already loaded (provides
|
||||
# sensor.lvx6048_stack_ac_output_active_power).
|
||||
# 4. Restart HA.
|
||||
#
|
||||
# Produces two dashboard-ready entities:
|
||||
# sensor.solar_harvested_today kWh — PV generated today (both inverters)
|
||||
# sensor.solar_used_today kWh — household load consumed today
|
||||
#
|
||||
# Data sources & why:
|
||||
# - Harvested: each inverter exposes a *lifetime* Wh counter
|
||||
# (total_pv_generated_energy); the LVX6048 firmware has no daily-energy
|
||||
# query (ED is NAKed). A daily utility_meter on the lifetime counter gives
|
||||
# today's harvest from the inverter's own internal accumulator (accurate).
|
||||
# - Used: no cumulative load counter exists, so the household load *power*
|
||||
# (sensor.lvx6048_stack_ac_output_active_power, sum of both inverters'
|
||||
# AC output from template_sensors.yaml) is Riemann-integrated into energy
|
||||
# and metered daily. This is an estimate; accuracy tracks powermon's GS
|
||||
# poll cadence. Counts only load served by the inverters.
|
||||
#
|
||||
# NOTE: verify the two source entity_ids match your HA install
|
||||
# (Developer Tools -> States): sensor.lvx6048_1_total_pv_generated_energy
|
||||
# and sensor.lvx6048_2_total_pv_generated_energy.
|
||||
|
||||
template:
|
||||
- sensor:
|
||||
- name: "Solar Harvested Today"
|
||||
unique_id: solar_harvested_today
|
||||
unit_of_measurement: "kWh"
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
icon: mdi:solar-power
|
||||
availability: >
|
||||
{{ has_value('sensor.solar_pv_today_unit_1')
|
||||
and has_value('sensor.solar_pv_today_unit_2') }}
|
||||
state: >
|
||||
{{ ((states('sensor.solar_pv_today_unit_1') | float(0))
|
||||
+ (states('sensor.solar_pv_today_unit_2') | float(0))) / 1000 }}
|
||||
|
||||
# Riemann-sum integration: household load power (W) -> energy (kWh)
|
||||
sensor:
|
||||
- platform: integration
|
||||
source: sensor.lvx6048_stack_ac_output_active_power
|
||||
name: "Household Load Energy"
|
||||
unique_id: household_load_energy_total
|
||||
unit_prefix: k
|
||||
round: 3
|
||||
method: trapezoidal
|
||||
|
||||
# Daily-resetting meters (reset at local midnight)
|
||||
utility_meter:
|
||||
solar_pv_today_unit_1:
|
||||
source: sensor.lvx6048_1_total_pv_generated_energy
|
||||
cycle: daily
|
||||
solar_pv_today_unit_2:
|
||||
source: sensor.lvx6048_2_total_pv_generated_energy
|
||||
cycle: daily
|
||||
solar_used_today:
|
||||
source: sensor.household_load_energy
|
||||
cycle: daily
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Dashboard card (paste into a Lovelace view, or Raw config editor):
|
||||
#
|
||||
# type: horizontal-stack
|
||||
# cards:
|
||||
# - type: tile
|
||||
# entity: sensor.solar_harvested_today
|
||||
# name: Harvested Today
|
||||
# icon: mdi:solar-power
|
||||
# color: amber
|
||||
# - type: tile
|
||||
# entity: sensor.solar_used_today
|
||||
# name: Used Today
|
||||
# icon: mdi:home-lightning-bolt
|
||||
# color: blue
|
||||
# ---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user