pred_bat: module: predbat class: PredBat template: True # ------------------------------------------------------------------ # Machine learning and forecasting options # ------------------------------------------------------------------ battery_scaling_auto: true # Enable ML load prediction load_ml_enable: true # Use the output data in Predbat (can be false to explore the use without using the data) # load_ml_source: true # Optional: Maximum days of historical data to fetch from HA on each poll (default: 28) # load_ml_max_days_history: 28 # Optional: Number of days of history to accumulate in the on-disk database (default: 90) # load_ml_database_days: 90 # Enable temperature predictions (RECOMMENDED for ML load prediction) temperature_enable: true # Optional: specify coordinates (defaults to zone.home) # temperature_latitude: 51.5074 # temperature_longitude: -0.1278 plan_interval_minutes: 15 # ------------------------------------------------------------------ # Basic setup # ------------------------------------------------------------------ prefix: predbat timezone: Europe/Stockholm currency_symbols: - "Kr" - "öre" threads: auto load_filter_threshold: 30 # load_ml_source: true # ------------------------------------------------------------------ # Historical energy sensors # # These are kWh today sensors, not live W sensors. # Created by the Home Assistant package: # packages/predbat_energy_today.yaml # ------------------------------------------------------------------ load_today: - sensor.predbat_load_today import_today: - sensor.predbat_import_today export_today: - sensor.predbat_export_today pv_today: - sensor.inverter_daily_yield # ------------------------------------------------------------------ # Huawei inverter setup # ------------------------------------------------------------------ num_inverters: 1 inverter_type: "HU" # Allow Predbat freeze/hold logic to use charge/discharge rate limits. # # For Huawei this maps to: # - Hold / Freeze charge: maximum_discharging_power = 0 # - Freeze export: maximum_charging_power = 0 # - Demand: both restored to normal configured max inverter: support_charge_freeze: true support_discharge_freeze: true # ------------------------------------------------------------------ # Huawei live sensors # # Sign convention: # # sensor.batteries_charge_discharge_power: # negative = discharging # positive = charging # # sensor.power_meter_active_power: # positive = importing / buying from grid # negative = exporting / selling to grid # ------------------------------------------------------------------ soc_percent: - sensor.batteries_state_of_capacity battery_power: - sensor.batteries_charge_discharge_power battery_power_invert: - true pv_power: - sensor.pv_input_power load_power: - sensor.house_load_power_calc grid_power: - sensor.power_meter_active_power grid_power_invert: - false # ------------------------------------------------------------------ # Huawei control entities # ------------------------------------------------------------------ charge_rate: - number.inverter_maximum_charging_power discharge_rate: - number.inverter_maximum_discharging_power charge_limit: - number.inverter_end_of_charge_soc # ------------------------------------------------------------------ # Battery capacity and safety limits # # soc_max is battery capacity in kWh, not percent. # Change this if your battery is not 10 kWh. # ------------------------------------------------------------------ soc_max: - 10 reserve: - 12 battery_min_soc: - 12 inverter_reserve_max: 98 # ------------------------------------------------------------------ # Huawei Solar service control # # stop_forcible_charge is used for both charge stop and discharge stop, # because Huawei/Predbat templates often use it as a general stop command. # ------------------------------------------------------------------ charge_start_service: service: huawei_solar.forcible_charge_soc device_id: "YOUR_HUAWEI_DEVICE_ID" target_soc: "{target_soc}" power: "{power}" charge_stop_service: service: huawei_solar.stop_forcible_charge device_id: "YOUR_HUAWEI_DEVICE_ID" discharge_start_service: service: huawei_solar.forcible_discharge_soc device_id: "YOUR_HUAWEI_DEVICE_ID" target_soc: "{target_soc}" power: "{power}" discharge_stop_service: service: huawei_solar.stop_forcible_charge device_id: "YOUR_HUAWEI_DEVICE_ID" # ------------------------------------------------------------------ # Inverter and battery power limits # # Values are in watts. # ------------------------------------------------------------------ inverter_limit: - 6000 battery_rate_max: - 5000 inverter_limit_charge: - 5000 inverter_limit_discharge: - 5000 inverter_limit_charge_dc: - 5000 # ------------------------------------------------------------------ # Clock skew # # Keep these close to 0 unless you see timing problems. # ------------------------------------------------------------------ inverter_clock_skew_start: 0 inverter_clock_skew_end: 0 inverter_clock_skew_discharge_start: 0 inverter_clock_skew_discharge_end: -1 clock_skew: 2 # ------------------------------------------------------------------ # Solar forecast # ------------------------------------------------------------------ #pv_forecast_today: sensor.solcast_pv_forecast_forecast_today #pv_forecast_tomorrow: sensor.solcast_pv_forecast_forecast_tomorrow #pv_forecast_d3: sensor.solcast_pv_forecast_forecast_day_3 #pv_forecast_d4: sensor.solcast_pv_forecast_forecast_day_4 #pv_forecast_today_attribute: detailedForecast #pv_forecast_tomorrow_attribute: detailedForecast #pv_forecast_d3_attribute: detailedForecast #pv_forecast_d4_attribute: detailedForecast open_meteo_forecast: - latitude: 0.0 # Replace with your latitude longitude: 0.0 # Replace with your longitude kwp: 9.5 declination: 18 azimuth: 47 # ------------------------------------------------------------------ # Car charging # ------------------------------------------------------------------ car_charging_energy: - sensor.go_echarger_energy_kwh # car_charging_power is the live charging power of your car charger, in Watts # It is display only - it drives the car shown on the web interface power flow diagram # and the predbat.car_charging_power sensor. The plan itself is unaffected by it. #car_charging_power: #- sensor.go_echarger_nrg_12 num_cars: 1 car_charging_planned: - 're:(binary_sensor\.go_echarger_265216_car)' car_charging_planned_response: - "on" # car_charging_plugged can be set to a sensor that says only whether the car is plugged in - staying on after # its charge has finished - matched against car_charging_planned_response. Predbat resets the manual car SoC # (input_number.predbat_car_charging_manual_soc_kwh) to 0 when it reads unplugged, and with car_charging_energy # set it tracks the SoC of a car that has no car_charging_soc sensor. One entry per car - e.g. for a myenergi Zappi: #car_charging_plugged: # - 're:(sensor.myenergi_zappi_[0-9a-z]+_plug_status)' # car_charging_now can be set to a sensor that shows the car is charging right now, so that # Predbat holds the house battery for the car while it charges. It never adds a charging slot. # Use an on/off sensor (matched against car_charging_now_response), or a charging power sensor # in W or kW where 200W or more counts as charging - e.g. for a Wallbox charger: #car_charging_now: # - sensor.wallbox_portal_charging_power car_charging_now_response: - "yes" - "on" - "true" - "charging" car_charging_battery_size: - 69.45 car_charging_limit: - input_number.predbat_ev_soc car_charging_soc: - sensor.june_battery_level # ------------------------------------------------------------------ # Energy rates from Nordpool package sensors # # These should expose today + tomorrow prices. # They should NOT be only current price sensors. # ------------------------------------------------------------------ metric_octopus_import: sensor.predbat_import_nordpool metric_octopus_export: sensor.predbat_export_nordpool # Standing charge disabled for Sweden/Nordpool setup. # metric_standing_charge: 0 # ------------------------------------------------------------------ # Load history and forecast horizon # ------------------------------------------------------------------ # Days previous sets how many days of load history Predbat searches when forecasting your future house load # (weighted-bucket forecast by default via days_previous_auto - see documentation for other options) days_previous: - 7 forecast_hours: 48 battery_scaling: - 1.0 import_export_scaling: 1.0 # ------------------------------------------------------------------ # Notifications # ------------------------------------------------------------------ notify_devices: - "YOUR_NOTIFY_DEVICE" # ------------------------------------------------------------------ # Alert feeds # # Customise to your country, alert types, severity and keep value. # Remove the alert types you do not want to trigger on. # ------------------------------------------------------------------ alerts: url: "https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-sweden" event: "(Amber|Yellow|Orange|Red).*(Wind|Snow|Fog|Rain|Thunderstorm|Frost|Heat|Flood|Forestfire|Ice|Low temperature|Storm|Tornado|Volcano|Wildfire)" severity: "Moderate|Severe|Extreme" certainty: "Possible|Likely|Expected" keep: 40 # ------------------------------------------------------------------ # Huawei LUNA charge/discharge power curves # # Values are approximate and mainly used so Predbat models the natural # tapering near full/empty battery more realistically. # Format: SOC percent -> available power percent # ------------------------------------------------------------------ #battery_charge_power_curve_auto: true #battery_discharge_power_curve_auto: true # battery_charge_power_curve: # 0: 1.00 # 10: 1.00 # 20: 1.00 # 30: 1.00 # 40: 1.00 # 50: 1.00 # 60: 1.00 # 70: 1.00 # 80: 0.95 # 85: 0.85 # 90: 0.70 # 95: 0.45 # 98: 0.25 # 100: 0.10 # battery_discharge_power_curve: # 100: 1.00 # 90: 1.00 # 80: 1.00 # 70: 1.00 # 60: 1.00 # 50: 1.00 # 40: 1.00 # 30: 1.00 # 20: 0.90 # 15: 0.75 # 10: 0.50 # 5: 0.25 # 0: 0.10 # ------------------------------------------------------------------ # Optional export triggers # # Uncomment only if you want Predbat to create export trigger sensors. # ------------------------------------------------------------------ # export_triggers: # - name: "large" # minutes: 60 # energy: 1.0 # - name: "small" # minutes: 15 # energy: 0.25 # ------------------------------------------------------------------ # Optional watch list # # Uncomment if you want Predbat to recalculate when car sensors change. # ------------------------------------------------------------------ # watch_list: # - "+[car_charging_planned]" # ------------------------------------------------------------------ # Predbat database # ------------------------------------------------------------------ #db_enable: true #db_days: 30 #db_mirror_ha: true