Switching power source from grid to battery

hi,

just recently I installed two solar panels with peak power of 600 watts. One of these all in one products you simply plug into the wall outlet.
On sunny days the panels and its inverter deliveres 600 watts easily. During daytime the base load of all power consuming devices in my home is roughly 400 watts. In order to not lose/return power to the grid, I created an automation to charge an ecoflow river pro battery when the delta of solar power production and consumed power is higher than 150 watts. Slow charging of ecoflow takes 110 watts. This is being done with a smart plug between ecoflow battery and wall power plug.

So far so good, this does work as intented, but I’d like to use the battery automatically during night times. Currently I take the ecoflow and plug some power hungry devices into it. But I have to do this manually.

I guess, what I am looking for is a switch which switches between two power sources. That way I could connect the ecoflow e.g. to my 24/7 server and if ecoflow is fully charged, switch (automatically) from grid to battery and if the battery runs out switch back to grid again.

The functionality is something like a simple DPDT Switch but these switches neither do exist off the shelf nor have I found any switch which is smart.

Does anyone have an idea if something like this actually exists or does have a better idea how to accomplish this switching?

Best
Pete

2 Likes

hi, I would like to realize a similar structure. I already have the hardware for this. The only thing I’m missing is the automation you’re writing about here. I would like to charge the battery from the socket during the day as soon as the solar panels generate more than 200 watts. I can determine the delta with a Shelly EM3 and would like to transfer this value to the Ecoflow.

here’s my charging automation:

alias: Energy - charge River Pro with power delta
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.total_consumption_grid
    below: -100
    for:
      hours: 0
      minutes: 2
      seconds: 0
  - platform: numeric_state
    entity_id: sensor.total_consumption_grid
    above: 50
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: template
    value_template: >-
      {{ (states('sensor.river_pro_main_battery_level')|int(0)) >=
      (states('number.river_pro_max_charge_level')|int(0)) }}
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.total_consumption_grid
            below: -100
          - condition: not
            conditions:
              - condition: numeric_state
                entity_id: sensor.river_pro_main_battery_level
                above: 97
          - condition: state
            entity_id: switch.plug_ecoflow_switch
            state: "off"
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.plug_ecoflow_switch
          - delay:
              hours: 0
              minutes: 0
              seconds: 30
              milliseconds: 0
          - service: input_number.set_value
            target:
              entity_id: input_number.river_pro_battery_charging_percentage
            data:
              value: "{{ states('sensor.river_pro_main_battery_level') }}"
          - service: notify.mobile_app_current
            data:
              message: by Sun at {{ states('sensor.river_pro_main_battery_level') }}%
              title: Battery Charging started
      - conditions:
          - condition: numeric_state
            entity_id: sensor.total_consumption_grid
            above: 50
          - condition: state
            entity_id: switch.plug_ecoflow_switch
            state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.plug_ecoflow_switch
          - service: notify.mobile_app_current
            data:
              message: >-
                by Sun at {{ states('sensor.river_pro_main_battery_level') }}%.
                Charged by {{
                (states('sensor.river_pro_main_battery_level'))|int(0) -
                (states('input_number.river_pro_battery_charging_percentage'))|int(0)
                }}%
              title: Battery Charging stopped
      - conditions:
          - condition: template
            value_template: >-
              {{ (states('sensor.river_pro_main_battery_level')|int(0)) >=
              (states('number.river_pro_max_charge_level')|int(0)) }}
          - condition: state
            entity_id: switch.plug_ecoflow_switch
            state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.plug_ecoflow_switch
          - service: notify.mobile_app_current
            data:
              message: >-
                by Limiter at {{ states('sensor.river_pro_main_battery_level')
                }}%. Charged by {{
                (states('sensor.river_pro_main_battery_level'))|int(0) -
                (states('input_number.river_pro_battery_charging_percentage'))|int(0)
                }}%
              title: Battery Charging stopped
mode: single

it also sends out messages when charging starts and charging stops.
Therefore you need a helper called

input_number.river_pro_battery_charging_percentage

in my case. This is for calculating the charged percentage since last charging started.

The River Pro has only two charging mode: slow and fast. slow charges at 110W and you need to take care, that slow charging is enabled on the ecoflow.

Best

1 Like