Repository navigation
Replies: 2 comments
|
Ok this is not working great. It would be great to have a working automation to handle this... anybody figured this out? |
|
I will share my predbat apps.yaml. ------------------------------------------------------------------Predbat Configuration for Deye SG05LP3 (Lewa-Reka ESPHome)Version: 2026-02-28 - Fully rewritten service calls------------------------------------------------------------------pred_bat: prefix: predbat --- INVERTER TYPE & CAPABILITIES ---num_inverters: 1 LiFePO4 charge curve: Full speed max rate up to 90%, then CC-CV taperingbattery_charge_power_curve: calculate_inverter_limit: True Forces Predbat to utilize freeze functions instead of alternative methodsinverter: --- SENSORS ---load_today: Battery Monitoringmetric_battery_cycle: 1.0 battery_power: --- WRITEABLES (Registers controlled by Predbat) ---charge_start_time: --- SERVICES ---Core logic notes for Deye:- Work mode is ALWAYS "Selling First".- "Zero Export To Load" is NEVER used as it blocks battery home discharge via the home load port.- Peak Shaving: ON = Normal operation (Grid limit active, no free export). OFF = Export mode (Battery sells freely to grid).- Charge/Discharge currents are set to 0 to mimic freeze behaviors. Currents are automatically restored by subsequent service calls.CHARGE START: Forced charging from grid (triggered during cheap import rates)charge_start_service: CHARGE STOP: Return to normal operationcharge_stop_service: CHARGE FREEZE: Hold SoC (Blocks discharging)charge_freeze_service: DISCHARGE START: Forced grid exportdischarge_start_service: DISCHARGE STOP: Return to normal operation (Identical to charge_stop)discharge_stop_service: DISCHARGE FREEZE: Hold SoC (Blocks charging, allows home discharging)discharge_freeze_service: --- NEGATIVE PRICE LOGIC ---set_export_limit: True --- RATES & FORECASTS ---metric_octopus_import: sensor.energy_knights_import_rates --- CUSTOM BEHAVIORS ---octopus_intelligent_charging: False # Disabled: Custom rates used instead of Octopus --- EV CONFIGURATION ---num_cars: 1 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I wanted to share my implementation for communicating with predbat. There are still optimizations possible but I think it can serve as a good start:
"
alias: Master Deye Parameter Sync TIME-AWARE
description: |
Dynamische interval: overdag (7-24h) elke 3 min, 's nachts (0-7h) elke 5 min.
Reduceert Modbus writes met ~30% zonder functionaliteit te verliezen.
triggers:
# Overdag: elke 3 minuten (7:00 - 23:57)
- trigger: time_pattern
minutes: /3
# 's Nachts: elke 5 minuten (0:00 - 6:55)
- trigger: time_pattern
minutes: /5
# Altijd triggeren bij belangrijke state changes
- trigger: state
entity_id:
- binary_sensor.predbat_charging
- binary_sensor.predbat_car_charging_slot
- input_number.predbat_set_reserve_min
conditions:
# Filter: overdag trigger alleen op /3, 's nachts alleen op /5
- condition: template
value_template: >
{% set h = now().hour %}
{% set m = now().minute %}
{% if trigger.platform == 'state' %}
true
{% elif h >= 7 and h < 24 %}
{{ m % 3 == 0 }}
{% else %}
{{ m % 5 == 0 }}
{% endif %}
actions:
- variables:
MAX_GRID_LIMIT: 4800
MAX_AMP_LIMIT: 120
EV_CHARGE_RATE_W: 2300
current_load_watts: "{{ states('sensor.deye_inverter_load_power') | float(2000) }}"
battery_voltage: "{{ states('sensor.deye_inverter_battery_voltage') | float(50) }}"
current_soc: "{{ states('sensor.deye_inverter_battery') | float(50) }}"
battery_min_soc: "{{ states('input_number.predbat_set_reserve_min') | float(10) }}"
predbat_online: "{{ states('binary_sensor.predbat_charging') not in ['unavailable', 'unknown', 'none'] }}"
is_charging: "{{ predbat_online and is_state('binary_sensor.predbat_charging', 'on') }}"
is_car_charging_slot: "{{ predbat_online and is_state('binary_sensor.predbat_car_charging_slot', 'on') }}"
best_charge_limit_percent: >
{% set limit = state_attr('predbat.predbat', 'best_charge_limit') %}
{{ limit | float(battery_min_soc) if limit != None else battery_min_soc }}
mode: single
"
All reactions