# Entity Fix Quick Reference ## Global Search & Replace Operations ### 1. Fix OpenEMS Entity Names (ALL v2 and v3 files) ```bash # Replace in all YAML files sensor.openems_ess0_soc → sensor.esssoc sensor.openems_ess0_activepower → sensor.essactivepower sensor.openems_ess0_capacity → sensor.esscapacity sensor.openems_production_activepower → sensor.pv_power sensor.openems_consumption_activepower → sensor.house_consumption sensor.openems_grid_activepower → sensor.gw_netzbezug (or appropriate grid sensor) ``` ### 2. Fix V3 Input Number Names (V3 dashboards only) ```bash # Replace only in v3/*.yaml files input_number.battery_min_soc → input_number.battery_optimizer_min_soc input_number.battery_max_soc → input_number.battery_optimizer_max_soc input_number.battery_charging_power → input_number.battery_optimizer_max_charge_power input_number.battery_reserve_capacity → input_number.battery_optimizer_reserve_capacity input_number.battery_price_threshold → input_number.battery_optimizer_price_threshold ``` ### 3. Fix haStrom Sensor Name (ALL files) ```bash sensor.hastrom_flex_extended_current_price → sensor.hastrom_flex_ext ``` ### 4. Fix Input Text Name (ALL files) **Option A:** Rename the entity in Home Assistant UI: - Rename `input_text.battery_optimizer_status_2` to `input_text.battery_optimizer_status` **Option B:** Update all config files: ```bash input_text.battery_optimizer_status → input_text.battery_optimizer_status_2 ``` --- ## Entities to Create in Home Assistant ### 1. Create Input Select Helper **Via UI:** Settings → Devices & Services → Helpers → Create Helper → Dropdown **Name:** Battery Optimizer Strategy **Entity ID:** `input_select.battery_optimizer_strategy` **Options:** - Price Optimized - Solar Optimized - Mixed **Via YAML:** Add to `configuration.yaml`: ```yaml input_select: battery_optimizer_strategy: name: Battery Optimizer Strategy options: - "Price Optimized" - "Solar Optimized" - "Mixed" initial: "Price Optimized" icon: mdi:strategy ``` --- ## Files That Need Updates ### OpenEMS Entity Names (8 files) ``` openems/v2/battery_optimizer_dashboard.yaml openems/v3/battery_optimizer_dashboard.yaml openems/v3/battery_optimizer_dashboard_minimal.yaml openems/v3/battery_optimizer_dashboard_compact.yaml openems/v3/battery_optimizer_sections_minimal.yaml openems/v3/battery_optimizer_sections_compact.yaml openems/v3/battery_optimizer_sections_standard.yaml ``` ### V3 Input Number Names (7 files - same as above minus v2) All v3 dashboard files listed above. ### haStrom Sensor Name Check and update in all files that reference `sensor.hastrom_flex_extended_current_price`: ``` openems/v3/*.yaml (all dashboard files) ``` --- ## Quick Verification Commands ### Check if entities exist: ```bash # Via Home Assistant REST API curl -s -X GET "http://192.168.89.4:8123/api/states/sensor.esssoc" \ -H "Authorization: Bearer YOUR_TOKEN" | jq '.state' # Check multiple entities for entity in sensor.esssoc sensor.essactivepower sensor.esscapacity; do echo -n "$entity: " curl -s -X GET "http://192.168.89.4:8123/api/states/$entity" \ -H "Authorization: Bearer YOUR_TOKEN" | jq -r '.state' done ``` ### Search for entity references in config files: ```bash # Find all OpenEMS references grep -r "sensor.openems" openems/ # Find all battery_ input_number references (without optimizer) grep -r "input_number.battery_[^o]" openems/v3/ # Find haStrom extended price references grep -r "hastrom_flex_extended" openems/ ``` --- ## Current vs Correct Entity Names - Quick Lookup | Current State in HA | What Config SHOULD Use | What Config INCORRECTLY Uses | |---------------------|------------------------|------------------------------| | ✓ `sensor.esssoc` | `sensor.esssoc` | ✗ `sensor.openems_ess0_soc` | | ✓ `sensor.essactivepower` | `sensor.essactivepower` | ✗ `sensor.openems_ess0_activepower` | | ✓ `sensor.esscapacity` | `sensor.esscapacity` | ✗ `sensor.openems_ess0_capacity` | | ✓ `sensor.pv_power` | `sensor.pv_power` | ✗ `sensor.openems_production_activepower` | | ✓ `sensor.house_consumption` | `sensor.house_consumption` | ✗ `sensor.openems_consumption_activepower` | | ✓ `sensor.hastrom_flex_ext` | `sensor.hastrom_flex_ext` | ✗ `sensor.hastrom_flex_extended_current_price` | | ✓ `input_number.battery_optimizer_min_soc` | `input_number.battery_optimizer_min_soc` | ✗ `input_number.battery_min_soc` (v3) | | ✓ `input_number.battery_optimizer_max_soc` | `input_number.battery_optimizer_max_soc` | ✗ `input_number.battery_max_soc` (v3) | | ✓ `input_number.battery_optimizer_max_charge_power` | `input_number.battery_optimizer_max_charge_power` | ✗ `input_number.battery_charging_power` (v3) | | ✓ `input_text.battery_optimizer_status_2` | `input_text.battery_optimizer_status_2` | ✗ `input_text.battery_optimizer_status` | --- ## All Available ESS Sensors (for reference) ``` sensor.essactivechargeenergy # Total charge energy (Wh) sensor.essactivedischargeenergy # Total discharge energy (Wh) sensor.essactivepower # Current power (-26 W = charging) sensor.essactivepowerl1 # L1 power sensor.essactivepowerl2 # L2 power sensor.essactivepowerl3 # L3 power sensor.esscapacity # Battery capacity (10000 Wh) sensor.essdcchargeenergy # DC charge energy sensor.essdcchargeenergykwh # DC charge energy (kWh) sensor.essdcdischargeenergy # DC discharge energy sensor.essdcdischargeenergykwh # DC discharge energy (kWh) sensor.essdischargepower # Discharge power sensor.essmaxpowersetpoint # Max power setpoint sensor.essminpowersetpoint # Min power setpoint sensor.essreactivepower # Reactive power sensor.esssoc # State of charge (%) ``` --- ## Automation Reload After Changes ```bash # Check configuration ha core check # Reload specific components (if supported) ha service call homeassistant.reload_config_entry # Full restart (safest option) ha core restart ```