🛴 E‑Roller Auto-Power-Off Script (Home Assistant)


This automation ensures that your electric scooter charging outlet is safely turned off once charging has completed – based on power consumption. It also notifies you immediately when charging is done.

Perfect for: Smart power management, battery preservation, and safe overnight charging via Home Assistant.

⚙️ What It Does

The automation continuously monitors the power draw of the scooter’s outlet. If the draw drops below 17W for more than 5 minutes, it:

  • Turns off the power outlet (e.g., Shelly, Zigbee plug, etc.)
  • Logs the event to the Home Assistant Logbook
  • Sends a push notification to your phone
  • Works even after Home Assistant restarts

📜 YAML Code

alias: E-Roller automatisch abschalten bei voller Ladung
description: >
  Schaltet die Steckdose aus, wenn der Stromverbrauch 5 Minuten lang unter 17W
  bleibt, und benachrichtigt dich – auch nach Home Assistant Neustart.
trigger:
  - platform: numeric_state
    entity_id: sensor.e_roller_power
    below: 17
    for: "00:05:00"
  - platform: time_pattern
    minutes: "/5"
  - platform: homeassistant
    event: start
condition:
  - condition: state
    entity_id: switch.e_roller_outlet
    state: "on"
  - condition: numeric_state
    entity_id: sensor.e_roller_power
    below: 17
action:
  - service: logbook.log
    data:
      name: E-Roller Automation
      message: Stromverbrauch seit 5 Minuten unter 17W – Steckdose wird ausgeschaltet.
  - service: switch.turn_off
    target:
      entity_id: switch.e_roller_outlet
  - service: notify.mobile_app_iphone_randy
    data:
      title: E-Roller geladen ✅
      message: Der E-Roller ist voll – die Steckdose wurde ausgeschaltet.
mode: single

🛠️ Requirements

  • sensor.e_roller_power: A power consumption sensor for the outlet (e.g., via Shelly, Zigbee plug)
  • switch.e_roller_outlet: Controllable smart outlet for charging
  • notify.mobile_app_iphone_randy: Your mobile app notification service