Replies: 5 comments 1 reply
-
| I guess I know what you intention is, but first I have a different question just for my understanding: As to your other questions (also from he closed ticket): 
 And lastly, yes, the automation might help to fully understand your intention, along with a rough wiring scheme of your setup. | 
Beta Was this translation helpful? Give feedback.
-
| Thanks for your reply. The wiring scheme is a "Kaskadenschaltung" as described here: https://blog.naturstrom.de/energiewende/kaskadenschaltung/ There are two electricity meters involved: An outer meter and an inner meter. This setup seems to be necessary to get a lower rate for the heat pump power. Each meter counts the energy consumed and produced. I'm measuring the heat pump consumption with a shelly EM 3 Pro. The sonnenbatterie measures the home consumption but does not include the heat pump. My goal is to delay or pause loading the battery in the morning when the heat pump is running (at least on sunny days). I haven't found an easy way to achieve that goal. Quite the opposite: When I set a charge target, then the battery won't discharge when needed (home power > pv production). Ideally I could set some target value for the grid feed-in for the battery. I'm trying to compute this value in the automation now. I'm decomposing the automation in five simpler automations: 
 This might seem a bit rough, but it allows me to start and stop the optimization manually (by starting or stopping the timer), I can display the values for the charge and discharge target and look at the traces. Here's the yaml code: Automation 1 alias: "WP+PV 1: Laden der Batterie wg. Wärmepumpe anpassen (Timer start)"
description: ""
triggers:
  - minutes: /5
    trigger: time_pattern
    hours: "6"
  - minutes: /5
    trigger: time_pattern
    hours: "7"
  - minutes: /5
    trigger: time_pattern
    hours: "8"
  - minutes: /5
    trigger: time_pattern
    hours: "9"
conditions:
  - condition: state
    entity_id: timer.resetbatterysuspend
    state: idle
  - condition: numeric_state
    entity_id: sensor.shellypro3em_34987a46a2a4_total_active_power
    above: 100
  - condition: numeric_state
    entity_id: sensor.sonnenbatterie_218665_state_battery_percentage_real
    above: 5
  - condition: numeric_state
    entity_id: sensor.sonnenbatterie_218665_state_production
    above: 1500
  - condition: numeric_state
    entity_id: sensor.energy_production_today_remaining
    above: 10
actions:
  - action: persistent_notification.create
    metadata: {}
    data:
      message: "WP+PV 1: Laden der Batterie wg. Wärmepumpe anpassen (Timer start)"
  - action: timer.start
    metadata: {}
    data: {}
    target:
      entity_id: timer.resetbatterysuspend
mode: singleAutomation 2 alias: >-
  WP+PV 2: Batterie in manuellen Modus setzen (Start 2. Timer.start => Batterie
  Manuell)
description: ""
triggers:
  - trigger: event
    event_type: timer.started
    event_data:
      entity_id: timer.resetbatterysuspend
  - trigger: event
    event_type: timer.restarted
    event_data:
      entity_id: timer.resetbatterysuspend
conditions: []
actions:
  - action: persistent_notification.create
    metadata: {}
    data:
      message: >-
        WP+PV 2: Batterie in manuellen Modus setzen (Start 2. Timer.start =>
        Batterie Manuell)
  - device_id: eb3a5ae6551232cc916e0691dca9bc81
    domain: select
    entity_id: 1a7987114a2508acc42b67ed42afda70
    type: select_option
    option: manual
    enabled: true
mode: single
Automation 3 alias: "WP+PV 3: Batterieladung an WP-Verbrauch anpassen (Während)"
description: ""
triggers:
  - trigger: time_pattern
    seconds: /10
    hours: "6"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "7"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "8"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "9"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "10"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "11"
    minutes: "*"
  - trigger: time_pattern
    seconds: /10
    hours: "12"
    minutes: "*"
conditions:
  - condition: state
    entity_id: timer.resetbatterysuspend
    state: active
    enabled: true
actions:
  - action: input_number.set_value
    metadata: {}
    data_template:
      value: >-
        {{ min(3400, max(0,
        (states('sensor.sonnenbatterie_218665_state_production')| float(0))  -
                  (states('sensor.shellypro3em_34987a46a2a4_total_active_power')| float(0)) -
                  (states('sensor.sonnenbatterie_218665_state_consumption_current')| float(0))              
              )) }}
    target:
      entity_id: input_number.wp_pv_ladeziel
  - action: input_number.set_value
    metadata: {}
    data_template:
      value: >-
        {{  min(3400, max(0,
        (states('sensor.sonnenbatterie_218665_state_consumption_current')|
        float(0))  -
                  (states('sensor.sonnenbatterie_218665_state_production')| float(0))              
              )) }}
    target:
      entity_id: input_number.wp_pv_entladeziel
  - if:
      - condition: numeric_state
        entity_id: input_number.wp_pv_entladeziel
        above: 0
    then:
      - action: number.set_value
        metadata: {}
        data:
          value: "{{states('input_number.wp_pv_entladeziel')|float(0)}}"
        target:
          entity_id: number.sonnenbatterie_218665_number_discharge
        enabled: true
    else:
      - action: number.set_value
        metadata: {}
        data:
          value: "{{states('input_number.wp_pv_ladeziel')|float(0)}}"
        target:
          entity_id: number.sonnenbatterie_218665_number_charge
mode: single
Automation 4 alias: "WP+PV 4: Timer beenden wenn WP aus (Stop 1)"
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.vvm500_pumpe_zustand_trigger
    from: null
    to: "off"
    enabled: true
  - trigger: numeric_state
    entity_id:
      - sensor.shellypro3em_34987a46a2a4_total_active_power
    below: 100
    enabled: true
conditions:
  - condition: state
    entity_id: timer.resetbatterysuspend
    state: active
actions:
  - action: notify.persistent_notification
    metadata: {}
    data:
      message: "WP+PV 4: Timer beenden wenn WP aus (Stop 1)"
  - action: timer.finish
    metadata: {}
    data: {}
    target:
      entity_id: timer.resetbatterysuspend
mode: singleAutomation 5 alias: >-
  WP+PV 5: Batterie wieder laden (Stop 2. Timer.finished => Automatikmodus
  Batterie)
description: ""
triggers:
  - trigger: event
    event_type: timer.finished
    event_data:
      entity_id: timer.resetbatterysuspend
  - trigger: event
    event_type: timer.cancelled
    event_data:
      entity_id: timer.resetbatterysuspend
  - trigger: event
    event_type: timer.paused
    event_data:
      entity_id: timer.resetbatterysuspend
conditions: []
actions:
  - action: notify.persistent_notification
    metadata: {}
    data:
      message: >-
        WP+PV 5: Batterie wieder laden (Stop 2. Timer.finished => Automatikmodus
        Batterie)
  - action: input_number.set_value
    metadata: {}
    data:
      value: 0
    target:
      entity_id:
        - input_number.wp_pv_ladeziel
        - input_number.wp_pv_entladeziel
  - device_id: eb3a5ae6551232cc916e0691dca9bc81
    domain: select
    entity_id: 1a7987114a2508acc42b67ed42afda70
    type: select_option
    option: automatic
    enabled: true
mode: single
 | 
Beta Was this translation helpful? Give feedback.
-
| Just for completeness: I got a reply from Sonnen (translated to English): I settled with adjusting every 20 seconds the charge / discharge level for the few hours the heat pump is running in the morning, so it should follow this advice. | 
Beta Was this translation helpful? Give feedback.
-
| Ich mach das mal auf Deutsch, weil einfacher ;) | 
Beta Was this translation helpful? Give feedback.
-
| 😄  Danke für den Hinweis, genau so ist es. Er hatte ein bisschen diskutiert, wo er die Messklemmen ansetzen soll und sie dann beim Hausverteiler belassen. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I built an automation that should optimize the PV usage for my heat pump in the morning. Often the sun shines, but the PV power is used to charge the battery. If we would adjusting loading the battery to a value such that the heat pump's power is fed into the grid, the PV would actually load the heat pump (as measured by a cascaded connection).
Example:
PV produces 1.200 Watts,
Home consumes 200 Watts,
heat pump consumes 700 Watts,
then battery charge should be 300 Watts.
If some conditions match (PV produces enough power, battery isn't completely empty, the solar forecast for today looks good and the heat pump is running) I change the sonnenbattery to manual mode.
I'm adjusting the charge or de-charge of the battery similarly to the example above every 10 seconds as long as the heat pump is running.
After that the sonnenbattery is set back to automatic mode.
Any opinions? Does setting the charge / de-charge level every 10 seconds sound acceptable or would you fear damaging the battery?
(If interested I can show the full automation. I'm not an expert in HA automation so it might not be as efficient as possible. I'm using a timer and listening to timer events which might be a bit convoluted, but I managed to get a solid understanding of the state of the automation).
Beta Was this translation helpful? Give feedback.
All reactions