Skip to main content
Energy Control Pro provides a switch entity to enable or disable the optimization runtime system.

Optimization Switch

switch.energy_control_pro_optimization
switch
Global switch to enable or disable optimization functionality.This switch controls whether Energy Control Pro actively manages connected loads based on available solar surplus. When enabled, the system monitors power flows and automatically turns loads on/off according to the selected strategy. When disabled, no optimization actions are performed.
name
string
default:"Energy Control Pro Optimization"
Display name of the switch entity
unique_id
string
Format: {entry_id}_optimization
icon
string
default:"mdi:tune-variant"
Material Design Icon identifier
is_on
boolean
Current state of the optimization switch
  • true: Optimization is enabled and active
  • false: Optimization is disabled

Services

The switch supports standard Home Assistant switch services:

Turn On

Enables the optimization engine.
service: switch.turn_on
target:
  entity_id: switch.energy_control_pro_optimization

Turn Off

Disables the optimization engine.
service: switch.turn_off
target:
  entity_id: switch.energy_control_pro_optimization

Toggle

Toggles the optimization state.
service: switch.toggle
target:
  entity_id: switch.energy_control_pro_optimization

Implementation Details

Coordinator Method (On)
method
async_set_optimization_enabled(True) - Called when turning on
Coordinator Method (Off)
method
async_set_optimization_enabled(False) - Called when turning off
State Source
data_key
The switch state is read from coordinator data key optimization_enabled

Usage Example

Automation to Enable During Peak Solar Hours

automation:
  - alias: "Enable optimization during solar hours"
    trigger:
      - platform: time
        at: "09:00:00"
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.energy_control_pro_optimization

  - alias: "Disable optimization at night"
    trigger:
      - platform: time
        at: "20:00:00"
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.energy_control_pro_optimization

Build docs developers (and LLMs) love