Hello, I would like to increase and decrease a power controller on my heater automatically step by step depending on PV power surplus.
I have a shelly that can measure the current at the heater power controller and I also have an electricity meter that displays the surplus.
Unfortunately I do not manage to build the automation . The controller is not set correctly. Where is the error? Can someone help me please? Here is my code:
By the way, the power controller is controlled by an ESP8266 via ESPHome as a light dimmer.
alias: Increase heater power
description: |-
Increase the power of the controller until the consumption is higher than the
value of the power supply.
trigger:
- platform: numeric_state
entity_id: sensor.stromueberschuss
above: sensor.heizstab_shelly_switch_0_power
condition: []
action:
- repeat:
until:
- condition: numeric_state
entity_id: sensor.heizstab_shelly_switch_0_power
above: sensor.stromueberschuss
sequence:
- service: light.turn_on
data:
brightness_step_pct: 1
target:
device_id: 97bd4f311d90ef232ef02d504a93f677
mode: restart