My goal is to turn on my waterheater, when my solarpanels are producing more that 1000W.
I did my automation i visual editor, and it works fine, if power from the panels drops below 1000W a few times a day. But if the sun is shining all day, the heater stays on after sunset.
The idea behind my automation is to turn on the heater if power is above 1000W - then wait 15 mins - turn off if power is below 1000W, or else turn on.
My issue is days when clouds lowers the power a few times during the day, the heater turn off after 15 mins, as it should. If power comes over 1000W it turns on again. Days with sun all day, the heater turns on, but does not turn off at the end of the day (when power comes below 1000W)
The code in YAML:
Your trigger is only triggering when you hit 1000W and it only will run when that happens - meaning if it’s 1000W for 12 hours then nothing triggers. You need a second trigger for falling below 1000W rather than an IF statement inside of your automation. Create two automations - one to turn it on and one to turn it off and I think it’ll work how you intend.
My guess is that you dipped below 1000 and back up again, re-triggering your automation. Your automation is clear: do not run unless it’s below 1000 and goes over 1000 - no other time. Also you have a delay there, so your dipping below 1000 may have happened during the 15 minutes.
And as the sun goes down, power falls to 0, and still it wont turn off.
I`ll try to create 2 automations, and still keep the delay off 15 mins because of the idiotic rules in this country
You can do a second automation or you can create multiple triggers using ID’s in a single automation but the thing to know is that your automation is only like this because of you evaluating a NUMERIC condition, and when you do that you need a couple more failsafe methods in place if you want something to happen repeatedly.
You’ll need to fill in the actions on the conditions but that’s one automation for turning it on at 1000+, turning it off at <1000 and turning it off if it’s on 15 minutes. Quick and dirty so I didn’t add all the actions but once you paste that into the automation you’ll know what to do next.
It’s hard to see in that graph but it looks like the peaks that you thought should turn on the switch didn’t fire because your trigger says “over 1000 for 5 minutes” and looking at a couple of those that you expect to trigger it appears they may have dipped below 1000 during that 5 minute span.