Photovoltaic

Hello

Could someone please check this script for errors? I want to control a bathroom radiator when my photovoltaic system feeds power into the public grid. I’d like to do it like this:

Switch on at high power, e.g., > 700 W

Switch off only at significantly lower power, e.g., < 500 W

Thanks


alias: PV Einspeisung schaltet Heizkörper (mit Hysterese)
description: “”
triggers:

  • entity_id: sensor.467b294959b97727a7388d4a9f9dc89b
    above: 700
    id: pv_hoch
    trigger: numeric_state
  • entity_id: sensor.467b294959b97727a7388d4a9f9dc89b
    below: 500
    id: pv_niedrig
    trigger: numeric_state
    conditions:
    actions:
  • choose:
    • conditions:
      • condition: trigger
        id: pv_hoch
        sequence:
      • target:
        entity_id: switch.fff317f0895765b02ff4fb17d1b772b6
        action: switch.turn_on
    • conditions:
      • condition: trigger
        id: pv_niedrig
        sequence:
      • target:
        entity_id: switch.fff317f0895765b02ff4fb17d1b772b6
        action: switch.turn_off

Hello Profile - Dunlop94 - Home Assistant Community,

Thanks for coming here and asking a question.
Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.
You can use the </> button like this… How to format your code in forum posts
OR… Here is an example of how to fix formatting from the site FAQ Page.
How to help us help you - or How to ask a good question.

Hello

Here is the original text cut out

Thanks and i wishing you a fantastic New Year

Do not post pictures of code. Please paste in the actual code as formatted text like @Sir_Goodenough showed you in his earlier post.

If you’re having an issue with your automation, it’s probably because the entity_id is messed up.
It should either be all human readable, like switch.your_sensor, or else it’ll be an alphanumeric value.

You seem to have both in the same line. Read this to learn more about it Why and how to avoid device_ids in automations and scripts

You don’t tell the power of your radiator, but I expect it’s more than 100W…
So let’s imagine it’s 400W radiator:
PV excess reach 700W >> Radiator turns ON >> 400W load drops excess to 300W >> automation turns it immediately back OFF.
Result is rapid on/off loop.