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 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.
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 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.