Myenergi Zappi automation that manages daytime charge

Post Reply
Dave Foster
Posts: 820
Joined: Thu Oct 13, 2022 7:21 pm

This automation manages the Zappi charger and switches it on and off depending on a number of conditions, such as home battery charge, solar generation and time of day.

Firstly set up a helper toggle which is used to change the priority given to the home battery, it the toggle switch is on the home battery will be allowed to charge from solar and the Zappi will be kept stopped, if the switch is turned off the Zappi will get priority but there has to be enough solar generation to cover the minimum use (1.4kw) and the home battery must be above a certain SoC.

The automation is active between 7.15 and 20.45

This is the setting for the helper toggle
IMG_1415.jpeg
This is the visual editor for the automation -
IMG_1417.png
IMG_1418.jpeg
IMG_1419.jpeg
This is the automation code (note i’ve changed my zappi serial number to 87654321 and you will need to select your device for the notifications.

Code: Select all


alias: Zappi Change Mode for EV Charging
description: >-
  Will change Zappi mode to Eco if the EV plug is in AND the battery is greater
  than 45% AND Zappi mode is Eco+ - otherwise sets Eco+
trigger:
  - platform: time_pattern
    minutes: /10
  - platform: time
    at: "20:30:00"
  - platform: state
    entity_id:
      - input_boolean.battery_first_priority
    from: "off"
    to: "on"
  - platform: state
    entity_id:
      - input_boolean.battery_first_priority
    from: "on"
    to: "off"
condition: []
action:
  - if:
      - condition: time
        after: "07:15:00"
        before: "20:45:00"
    then:
      - if:
          - condition: and
            conditions:
              - condition: or
                conditions:
                  - condition: state
                    entity_id: sensor.myenergi_zappi_87654321_plug_status
                    state: EV Connected
                  - condition: state
                    entity_id: sensor.myenergi_zappi_87654321_plug_status
                    state: Charging
              - condition: numeric_state
                entity_id: sensor.battery_soc
                above: 45
                enabled: true
              - condition: numeric_state
                entity_id: sensor.pv_power
                above: 1.4
              - condition: state
                entity_id: input_boolean.battery_first_priority
                state: "off"
              - condition: or
                conditions:
                  - condition: state
                    entity_id: select.myenergi_zappi_87654321_charge_mode
                    state: Eco+
                  - condition: state
                    entity_id: select.myenergi_zappi_87654321_charge_mode
                    state: Stopped
        then:
          - device_id: 15300798a849373356a7b18cacec767e
            domain: select
            entity_id: select.myenergi_zappi_87654321_charge_mode
            type: select_option
            option: Eco
          - device_id: d514ca0fc5e61f231178ed4d3b9fece8
            domain: mobile_app
            type: notify
            message: Zappi is set On
            data:
              push:
                sound: none
            enabled: true
        else:
          - if:
              - condition: or
                conditions:
                  - condition: numeric_state
                    entity_id: sensor.battery_soc
                    below: 40
                  - condition: state
                    entity_id: input_boolean.battery_first_priority
                    state: "on"
                  - condition: state
                    entity_id: sensor.myenergi_zappi_87654321_plug_status
                    state: Waiting for EV
            then:
              - if:
                  - condition: state
                    entity_id: select.myenergi_zappi_87654321_charge_mode
                    state: Eco
                then:
                  - device_id: 15300798a849373356a7b18cacec767e
                    domain: select
                    entity_id: select.myenergi_zappi_87654321_charge_mode
                    type: select_option
                    option: Stopped
                  - device_id: d514ca0fc5e61f231178ed4d3b9fece8
                    domain: mobile_app
                    type: notify
                    message: Zappi mode Stop(Charge)
                    data:
                      push:
                        sound: none
                    enabled: true
    else:
      - if:
          - condition: state
            entity_id: select.myenergi_zappi_87654321_charge_mode
            state: Eco
        then:
          - device_id: 15300798a849373356a7b18cacec767e
            domain: select
            entity_id: select.myenergi_zappi_87654321_charge_mode
            type: select_option
            option: Stopped
          - device_id: d514ca0fc5e61f231178ed4d3b9fece8
            domain: mobile_app
            type: notify
            message: Zappi mode Stopped (Time)
            data:
              push:
                sound: none
            enabled: true
mode: single

Post Reply