๐Ÿ”‹ Energy Management System for Car Charging (Surplus, Trip, Calendar)

I have created a set of blueprints for Home Assistant that can work together or individually to generate an Energy Management System (EMS) for your home. The focus today is on Charging electrical vehicles including a Surplus charging capabilities for those who want to leverage their Solar energy at home. The scripts works independently but needs to be set up in a way that helper entities are used.

The Blueprints

Type Change blueprint

This is the default script you will need to use if you start with your automation. This script makes sure to adopt the different settings based on a Charging Type - a helper entity - that contains the following Options (Default, Trip, Surplus, Morning-Min and Stop).

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Surplus blueprint

If Surplus is activate this script runs every 5 seconds to set the correct current value on the charger based on a potential power mean. To create a mean power sensor use the ha-average Extension Ideally you set a 5 min window on it to smooth peaks for the charger.

Example configuration.yaml entry for the average sensor

sensor:
  - platform: average
    name: "[EMS] - [Car] - Potential Power mean
    unique_id: ems_car_potential_power_mean
    entities:
      - sensor.ems_car_potential_power_now
    duration: 00:05:00

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Surplus Morning-Minimum

If you are using Surplus charging by default this script will make sure that you have at least a certain battery level in the morning when you want to leave.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Surplus go-e ECO

This is only useful for go-e charger owners that want to use the ECO mode. It publishes the available power over mqtt to the go-e charger. For this the home-assistant-goecharger-mqtt Extension is needed. As the charger is not really taking those values into account itโ€™s a nice to have but not necessary.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Trip Calendar Entry

Based on entries within a selectable calendar in Home assistant this script makes sure that your battery reaches a configurable state before you have to leave. You can leverage any calendar e.g. the Google Calendar Integration.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Additional information and potential further blueprints can be found here: GitHub - gsaurer/ha-ems: Energy managemnt system for Home Assistant

1 Like

Great job. It seems to be usefull for me. I have two questions. What sensor is ems_car_potential_power_now? And what switch is this: EMS - Enabled.

EMS enabled is a general switch you can use to enable/disable it. Best is to create one in the process of adding the template if you donโ€™t have it/use the created one in all other templates as well. ems_car_potential_power_now is how much power is available to charge the car at that momenten. I created a template sensor that uses the smart meter information about power export and creates a moving average for 5min.

Okay, I understand. Thank you very much. I already have a sensor for PV excess as well as a switch for my EV charger. I donโ€™t have EMS. What is EMS in this case? I apologize for my leaking knowledge and basic questions.

Hy All,
it seems that the Automation is doing what it should, at least the Trace tell me that it canโ€™t load the Car when there is not enough sun.
But when I have enough Sun available then the trace is correct, but the car is not charging. Where do I have to set the parameter on how to enable the charging with an Easee Walbox?
Maybe Iโ€™m missing something?

I donโ€™t have this Wallbox to test and i am not sure which HA integratio you are using to control it. If itโ€™s this: GitHub - nordicopen/easee_hass: Custom component for Easee EV charger integration with Home Assistant then I think you need to do the following:

The bluprints work on sensors that are setting the current value to charge. But your integrations seems to work with services/actions. I would set up a Helper sensor that holds the current that should be set and then create another automation that is triggered every time the sensor changes to call the service of the Wallbox with the value of the sensor. Examples for how to call the service are shown in the git project above.

Thanks a lot, I will try it.
Iโ€™m totally new to HA, so I will take some time to figure this out :smile: