8 min read

Tesla and the main fuse: shed the load before it trips, without going out in the middle of the night

The meter watches the total power of the house and the car: at a high load Home Assistant first lowers the Tesla's current, then stops the water heaters and restores everything when the load drops.

Level
Advanced
Active time
2–4 hours
Home Assistant required
Yes

An electric car is the biggest new consumer in a home. When it charges while the water heater, the oven and the air conditioners are running in the house, the total current easily reaches the limit of the main breaker. Then both the home and the charger trip. If the breaker is out in the yard, someone has to go out and switch it back on, sometimes in the middle of the night. We decided to have Home Assistant watch the total load and shed it by itself before that happens.

What you will get

  • A phone notification when the total load of the home and the car approaches the current of the main breaker.
  • Automatic load shedding in steps: first the car’s charging current, then the water heaters.
  • A notification of what has been stopped and another one when everything comes back.
  • Restoring the appliances and the car’s current when the load drops.

How it is with us

The 63 A main breaker is in the panel outside the building, next to the electricity meter, and powers everything. Inside, the home has its own 50 A breaker, and a line with a 32 A breaker goes to the underground garage and the charger. Together they are 82 A, more than 63 A: when the home and the car draw a lot at the same time, the outer main breaker trips, even though none of the inner ones has reached its limit.

That is why Home Assistant watches the total load. A Shelly EM with a 50 A clamp measures the home, and the power of the car’s charging is added to its power. The sum is compared with 63 A: at a high load we get a notification, and if it continues, an automation lowers the car’s charging current and, if still needed, switches off the water heaters. When the load drops, everything comes back by itself. We do not go out into the yard at midnight.

What you will need

  • Shelly EM with a 50 A current clamp: a two-channel single-phase power meter. It connects over Wi-Fi.
  • Home Assistant with the Tesla integration for the current and the charging state. We do not sell Teslas.
  • A relay or a smart plug for each water heater you will stop. At our place the big water heater is on a Shelly relay, and the small one on an IKEA INSPELNING smart plug.
  • A phone with the Home Assistant app for the notifications.

Setup time: two to four hours, most of it for the Tesla integration.

How it works

The Shelly EM gives the power of the home. A template adds the power of the car’s charging to it. Three automations watch this sum, not the individual breakers.

AutomationThreshold and waitWhat it does
Warningabove 10.5 kW (about 46 A) for 30 secondsA notification to the phones
Load sheddingabove 12 kW (about 52 A) for 15 secondsSheds the load in steps and sends a critical notification
Restorebelow 9 kW (about 39 A) for 5 minutesRestores the stopped appliances and resets the helpers

This way shedding starts with about 11 A of margin below 63 A, and the gap between 12 and 9 kW and the five minutes protect against switching on and off around one threshold. The amps are the kilowatts divided by 230 V.

The steps when shedding are:

  1. The car. If the Tesla is charging and is at home, its current is reduced by 10 A, but not below 8 A. Before that, the value it was charging with is remembered.
  2. The big water heater. After 20 seconds, if the load is still above 12 kW, its relay is switched off.
  3. The small water heater. After another 20 seconds, if the load is still above 12 kW, its smart plug is switched off.

If the car is not charging, you start from step 2. If after some step the load drops below 12 kW, the following ones are skipped.

Restoring is in reverse order: the small water heater, the big one, then the car’s current. The car is touched only if it is at home, still charging and its current is exactly the one that shedding left. If you changed it by hand, it stays as you left it.

Choose thresholds for your breaker

Power is voltage times current: 1 A at 230 V is about 230 W. First look at the rated current of your main breaker, the one that both the home and the charger pass through. At our place it is 63 A, about 14.5 kW. You set the warning below it with a clear margin (10.5 kW), the shedding is higher but still below the limit (12 kW), and the restore is far enough below the shedding (9 kW). The inner 50 A and 32 A breakers are not a measure for the sum: it is compared with the main one.

With a three-phase supply one Shelly EM measures one conductor and does not show the total load. Then you need a meter for all three phases.

Steps

  1. Install the Shelly EM and add the Shelly integration (Settings → Devices & services → Add integration → Shelly). You get sensors for power and voltage, at our place sensor.main_em_channel_1_power and sensor.main_em_channel_1_voltage. The Shelly EM is first generation: according to the Home Assistant documentation, such devices connect through CoIoT (UDP port 5683).
  2. Add the Tesla integration in Home Assistant. You need an entity for the charging current (number.<name>_charge_current) and an entity for the charging state (sensor.<name>_charging). At our place the car is named Tessie.
  3. Make the helpers: Toggle breaker_protection_active, two Toggles for “the water heater was on” (breaker_shed_main_wh_was_on and breaker_shed_kitchen_wh_was_on), Number breaker_shed_steps from 0 to 3 and Number tesla_charge_amps_pre_shed from 0 to 32 A.
  4. Make a Template sensor for the total load (Settings → Devices & services → Helpers → Template → Sensor; unit W, class power, state class measurement). This way the total load is the sum of the house and the car:
{% set house = states('sensor.main_em_channel_1_power') | float(0) %}
{% set car = states('sensor.tesla_home_charging_power') | float(0) * 1000 %}
{{ (house + car) | round(0) }}

sensor.tesla_home_charging_power is our own sensor in kW. You can start with the charging power sensor of the integration and check its unit of measurement. If your clamp already covers the charger cable too, remove car from the sum so as not to count the car twice.

  1. Put in the three automations below. Replace the entities and the notification services with your own.
alias: Breaker power warning
triggers:
  - trigger: numeric_state
    entity_id: sensor.main_breaker_load_w
    above: 10500   # 10.5 kW, about 46 A
    for:
      seconds: 30
conditions:
  - condition: state
    entity_id: input_boolean.breaker_protection_active
    state: "off"
actions:
  - action: notify.mobile_app_telefon
    data:
      title: High load
      message: >-
        {{ (states('sensor.main_breaker_load_w') | float / 1000) | round(1) }} kW
      data:
        push:
          interruption-level: time-sensitive
alias: Breaker load shedding
mode: single
triggers:
  - trigger: numeric_state
    entity_id: sensor.main_breaker_load_w
    above: 12000   # 12 kW, about 52 A
    for:
      seconds: 15
conditions:
  - condition: state
    entity_id: input_boolean.breaker_protection_active
    state: "off"
actions:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.breaker_protection_active
  - action: input_number.set_value
    target:
      entity_id:
        - input_number.breaker_shed_steps
        - input_number.tesla_charge_amps_pre_shed
    data:
      value: 0
  - action: "input_boolean.turn_{{ 'on' if is_state('switch.main_water_heater', 'on') else 'off' }}"
    target:
      entity_id: input_boolean.breaker_shed_main_wh_was_on
  - action: "input_boolean.turn_{{ 'on' if is_state('switch.kitchen_water_heater', 'on') else 'off' }}"
    target:
      entity_id: input_boolean.breaker_shed_kitchen_wh_was_on
  - if:
      - condition: state
        entity_id: sensor.tessie_charging
        state: charging
      - condition: state
        entity_id: device_tracker.tessie_location
        state: home
    then:
      - action: input_number.set_value
        target:
          entity_id: input_number.tesla_charge_amps_pre_shed
        data:
          value: "{{ states('number.tessie_charge_current') | int }}"
      - action: number.set_value
        target:
          entity_id: number.tessie_charge_current
        data:
          value: "{{ [states('number.tessie_charge_current') | int - 10, 8] | max }}"
      - action: input_number.set_value
        target:
          entity_id: input_number.breaker_shed_steps
        data:
          value: 1
      - delay:
          seconds: 20
  - if:
      - condition: numeric_state
        entity_id: sensor.main_breaker_load_w
        above: 12000
      - condition: state
        entity_id: switch.main_water_heater
        state: "on"
    then:
      - action: switch.turn_off
        target:
          entity_id: switch.main_water_heater
      - action: input_number.set_value
        target:
          entity_id: input_number.breaker_shed_steps
        data:
          value: 2
      - delay:
          seconds: 20
  - if:
      - condition: numeric_state
        entity_id: sensor.main_breaker_load_w
        above: 12000
      - condition: state
        entity_id: switch.kitchen_water_heater
        state: "on"
    then:
      - action: switch.turn_off
        target:
          entity_id: switch.kitchen_water_heater
      - action: input_number.set_value
        target:
          entity_id: input_number.breaker_shed_steps
        data:
          value: 3
  - action: notify.mobile_app_telefon
    data:
      title: Breaker protection triggered
      message: >-
        {{ (states('sensor.main_breaker_load_w') | float / 1000) | round(1) }} kW.
        Devices stopped: step {{ states('input_number.breaker_shed_steps') | int }} of 3.
      data:
        push:
          interruption-level: critical

This version is simplified: each step checks the load by itself.

alias: Breaker restore after load shed
mode: single
triggers:
  - trigger: numeric_state
    entity_id: sensor.main_breaker_load_w
    below: 9000    # 9 kW, about 39 A
    for:
      minutes: 5
conditions:
  - condition: state
    entity_id: input_boolean.breaker_protection_active
    state: "on"
actions:
  - if:
      - condition: numeric_state
        entity_id: input_number.breaker_shed_steps
        above: 2.5
      - condition: state
        entity_id: input_boolean.breaker_shed_kitchen_wh_was_on
        state: "on"
    then:
      - action: switch.turn_on
        target:
          entity_id: switch.kitchen_water_heater
  - if:
      - condition: numeric_state
        entity_id: input_number.breaker_shed_steps
        above: 1.5
      - condition: state
        entity_id: input_boolean.breaker_shed_main_wh_was_on
        state: "on"
    then:
      - action: switch.turn_on
        target:
          entity_id: switch.main_water_heater
  - if:
      - condition: numeric_state
        entity_id: input_number.tesla_charge_amps_pre_shed
        above: 0
      - condition: state
        entity_id: device_tracker.tessie_location
        state: home
      - condition: state
        entity_id: sensor.tessie_charging
        state: charging
      - condition: template
        value_template: "{{ states('number.tessie_charge_current') | int(-1) == [states('input_number.tesla_charge_amps_pre_shed') | int - 10, 8] | max }}"
    then:
      - action: number.set_value
        target:
          entity_id: number.tessie_charge_current
        data:
          value: "{{ states('input_number.tesla_charge_amps_pre_shed') | int }}"
  - action: input_number.set_value
    target:
      entity_id:
        - input_number.tesla_charge_amps_pre_shed
        - input_number.breaker_shed_steps
    data:
      value: 0
  - action: input_boolean.turn_off
    target:
      entity_id:
        - input_boolean.breaker_protection_active
        - input_boolean.breaker_shed_main_wh_was_on
        - input_boolean.breaker_shed_kitchen_wh_was_on
  - action: notify.mobile_app_telefon
    data:
      title: Load is back to normal
      message: "The load dropped to {{ (states('sensor.main_breaker_load_w') | float / 1000) | round(1) }} kW. The stopped devices are back on."

Checking the result

Temporarily lower the thresholds so that they are slightly above your usual load, and run the water heater and the car.

  • Normal case: in the automation’s Traces you see the steps, breaker_shed_steps grows, and the phone gets a notification.
  • Restore: when the load drops below the new restore threshold and you wait five minutes, the appliances switch on, breaker_protection_active becomes off, and breaker_shed_steps becomes 0.
  • Manual change: change the car’s current yourself while shedding lasts. The restore automation does not touch it.
  • Missing data: switch the Shelly integration off for a moment and see what the total sensor shows. When unavailable the template counts the house as 0, so also watch the meter’s availability.

After the test put the real thresholds back.

If it does not work

  • The protection does not trigger a second time → breaker_protection_active has stayed on → switch it off manually and reset breaker_shed_steps.
  • The car does not lower the current → number.tessie_charge_current is unavailable or the car is asleep → try a command from Developer tools → Actions.
  • It stops too early or too late → the sum counts the car twice or misses it → compare the total sensor with the reading on the panel.

How to stop it

Stop the three automations from Settings → Automations & scenes. The stopped appliances stay in the state they are in: switch them on by hand.

The measurement, Wi-Fi, the Tesla cloud and Home Assistant are sequential links: the car’s data updates less often than the meter’s, and from the threshold to the last step takes about a minute. The automation sheds only the car and the two water heaters, and knows nothing about appliances you have not described, such as an oven or a stove.

Sources and verification status

The three automations were read in Marto’s Home Assistant on 23.11.2026 (read-only): warning, load shedding and restore. They last triggered on 15.10.2026. The examples are simplified versions with sample entity names.

At home

Marto

The 63 A main fuse is in the panel outside the building, next to the electricity meter, and powers everything. Inside, the home has a 50 A fuse, and the line to the underground garage and the charger is 32 A. Since 50 + 32 is more than 63, the home and the car together can trip the outer fuse. Three automations (warning, load shedding, restore) watch the sum from the Shelly EM and the charging, and shed the load without us having to go out into the yard at night. They last triggered on 15.10.2026.

Need a hand?

We can set up and install everything in this project. In some regions we install it ourselves — ask us.

Contact us

Related projects

Shelly EM single-phase energy meter with 2 channels + clamp (1x transformer 50A)

63,90 €
View parts

What you need

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.