HomeAssistant OCPP + Shelly em3 = load balacing

TL;DR

  • configuration.yaml includes the sensor templates that calculates the total power and current on the most loaded phase
  • automations.yaml includes the automation for adjusting the charger current depending on the house load

Setup notes

  • ABB Terra AC wallbox is an affordable and well known EVSE with OCPP support. By default the charger is preconfigured to use the ABB cloud service for remote management and Apps. Unfortunately changing the OCPP server to your own needs some extra steps.

    Terra AC: TerraConfig App Step by Step Guide

    You either need help from someone who has experience with this charger or contact your ABB sales represetitive for following accounts:

    They are separate accounts tied to the same client, one is probably meant for service providers and the other for installers but to finish the configuration you need both.

    Example values for the OCPP profile:

    • Type: ws:// (this is an unsecure WebSocket version, not tested with the more secure wss://)
    • URL: 192.168.1.3:9000 (use your HomeAssistant server IP address)
    • Protocol Type: OCPP
    • Protocol Version: ocpp16j

    Use TerraConfig APP on the mobile device TerraConfig APP account to connect to the charger over Bluetooth and adding the charger using the chargers PIN code. You can then download the preconfigured OCPP profile to the charger.

  • Home Assistant OS runs on a small Intel NUC PC with 4G of RAM and 128GB SSD storage.

  • HACS offers community supported Integrations for HomeAssistant, we need it to add OCPP support.

  • OCPP Integration can be installed using HACS

After OCPP integration is set up the charger can connect to HomeAssistand and start sending statistics and polling commands. The two main features are Charger Availability that show whether the charger is in use or not. The other is Charger Maximum Current that adjusts the maximum allowed current for your charger.

HomeAssistant Shelly integration detects the Shelly em3 energy meter automatically and creates power and current entities for each phase.

  • Actual Power calculates the total power combined on all phases
  • Actual Current is the current on the most loaded phase. This virtual sensors makes the automation code more readable.