# Power Flow Card Plus Fix - Energy Flow Display Correction ✓ SOLVED ## Problem Summary The Power Flow Card Plus was incorrectly showing that all solar production was consumed by home, with no grid feed-in displayed. In reality, the system was feeding excess solar back to the grid. **Root Cause**: Wrong entity used for grid "Production" - was using cumulative energy sensor (kWh) instead of instantaneous power sensor (W). ## What Changed ### OLD Configuration (Working) ```yaml grid: entity: consumption: "sensor.tagstromverbrauch_momentan" # Grid consumption production: "sensor.tagstromverbrauch" # Grid feed-in home: use_metadata: true # Card auto-calculates: Solar + Grid = Home ``` ### NEW Configuration (Broken) ```yaml grid: entity: "sensor.grid_verbrauch_gesamt" # Combined, consumption-only home: use_metadata: true # Can't calculate properly without grid feed-in data ``` ## ✅ SOLUTION (User Found & Verified Working) **Use separated grid entities with correct sensors:** - **Consumption**: `sensor.grid_verbrauch_gesamt` (Tag + Nacht combined in W) - **Production**: `sensor.tagstromverbrauch` (instantaneous power in W) **Key**: Must use `tagstromverbrauch` (power), NOT `tagstromverbrauch_ausgehend` (cumulative energy)! ### Why This Works 1. **Includes both circuits**: `grid_verbrauch_gesamt` combines Tagstrom + Nachtstrom (LOGAREX) 2. **Correct unit**: `tagstromverbrauch` is instantaneous power (W), not cumulative energy (kWh) 3. **Proper energy flow calculation**: Card can now calculate: Home = Solar - Grid_Feed_in 4. **Verified working**: Display shows Solar 3.1 kW → Home 317W, Grid -2.8 kW feed-in ✓ ## ✅ Implementation (Already Done by User) ### Configuration via Home Assistant UI **Power Flow Card Plus → Grid Section:** 1. Expand "Separated Entities" section 2. **Consumption**: Select `Grid Verbrauch Gesamt` 3. **Production**: Select `Tagstromverbrauch` (NOT `Tagstromverbrauch_ausgehend`!) **Result in `/config/.storage/lovelace`:** ```json "grid": { "display_state": "one_way", "entity": { "consumption": "sensor.grid_verbrauch_gesamt", "production": "sensor.tagstromverbrauch" }, "invert_state": false, "use_metadata": false, "secondary_info": {} } ``` ### No Additional Steps Required The card calculates home consumption automatically with `use_metadata: true`: ``` Home = Solar - Grid_Production + Grid_Consumption = 3.1 kW - 2.8 kW + 0 kW = 0.3 kW (300W) ≈ 317W shown ✓ ``` ## Critical Files - **Power Flow Card Config**: `/config/.storage/lovelace` (SSH: icke@172.20.70.10) - **Template Sensors**: `/config/configuration.yaml` - **Git Repository**: `/config/.git/` (use `sudo git` for commands) ## ✅ Verified Behavior (Working) **Current Display (from user screenshot):** - **Solar**: 3.1 kW production - **Grid**: -2.8 kW (negative = feeding to grid) - **Home**: 317 W consumption - **Energy flows**: Solar→Home (small line), Solar→Grid (large line) **Calculation verification:** ``` Solar production: 3.1 kW Home consumption: 0.317 kW Excess to grid: 3.1 - 0.317 = 2.783 kW ≈ 2.8 kW ✓ ``` ## ✅ Verification Complete User confirmed working configuration: - ✅ Solar production displays correctly (3.1 kW) - ✅ Grid shows negative value when feeding in (-2.8 kW) - ✅ Home consumption realistic (317 W, not 3.1 kW) - ✅ Energy flow arrows display correctly ## Recommended Git Commit Document this fix in git: ```bash ssh icke@172.20.70.10 cd /config sudo git add .storage/lovelace sudo git commit -m "Fix: Power Flow Card Plus - Use correct sensors for grid consumption/production Grid configuration: - Consumption: sensor.grid_verbrauch_gesamt (Tag + Nacht combined, W) - Production: sensor.tagstromverbrauch (instantaneous power, W) Previous issue: Used tagstromverbrauch_ausgehend (cumulative kWh) which showed as 38,550 kW instead of actual feed-in power. Verified working: Solar 3.1kW → Home 317W, Grid feed-in -2.8kW Co-Authored-By: Claude Sonnet 4.5 " ``` ## Key Lesson Learned **The Problem Was NOT Missing Home Entity** The user initially thought: "we need to add some entity in the home section" **Actual problem**: Grid "Production" was using wrong sensor type: - ❌ `tagstromverbrauch_ausgehend` - cumulative energy (kWh) - totals 38,550! - ✅ `tagstromverbrauch` - instantaneous power (W) - shows ~2.8 kW The card needs **instantaneous power (W)** for both consumption and production to calculate energy flows correctly. ## Summary for Documentation **Problem**: Power Flow Card showing all solar going to home (incorrect) **Root Cause**: Grid production entity was cumulative energy (kWh) instead of instantaneous power (W) **Solution**: ``` Grid → Separated Entities: Consumption: sensor.grid_verbrauch_gesamt Production: sensor.tagstromverbrauch (NOT tagstromverbrauch_ausgehend) ``` **Result**: Correct display showing solar → home (small) + solar → grid feed-in (large) ✓ ## Sources - [Power Flow Card Plus GitHub](https://github.com/flixlix/power-flow-card-plus) - [Home Assistant Community - How does Power Flow Card Plus calculate home consumption](https://community.home-assistant.io/t/how-does-the-power-flow-card-plus-calculate-home-energy-consumption/721252)