Control dimmer based on sensor values

I would like to install a 200 watt heating cartridge in my hot water boiler. I would then like to control this with a Shelly Dimmer 2 depending on the excess electricity from the PV system. For example, if there is an excess of 153 W, this energy should be consumed by the heating cartridge, controlled by the Shelly dimmer. I already have the calculation from the electricity.
Unfortunately I don’t know exactly how to control Shelly’s the easiest way. Thanks for help!

I have now found the solution. Maybe someone can use them.

Sensor (sensor.power_heizstab)

#sensor für heizstab
    - name: "Power Heizstab"
      unique_id: power_heizstab_calc
      state: >-
        {{ 0.5 * (states('sensor.house_energy_negative')|float(0) + 
            states('sensor.io_heizstab_power')|float(0)) }}

Automation:

alias: Heizstab PV-Überschuss
description: ''
trigger:
  - platform: state
    entity_id:
      - sensor.power_heizstab
condition:
  - condition: numeric_state
    entity_id: sensor.house_energy_negative
    above: '0'
action:
  - service: light.turn_on
    data_template:
      entity_id:
        - light.io_heizstab
      brightness_pct: '{{ states(''sensor.power_heizstab'')|int }}'
1 Like

Hallo, dein Beitrag klingt sehr interessant, ich habe die gleiche Idee jedoch bisher leider nur die Idee also keine Lösung.

Welche Komponenten hast du in Einsatz und was sind deine Erfahrungswerte. Ich würde mich sehr freuen, wenn du mir helfen könntest.

Hallo hast du noch die Steuerungen in Einsatz

hi, hab sie nicht mehr im einsatz, da ich mitlerweile eine große pv mit speicher habe. kann dir aber gerne helfen.