Hi! I’m hopefully having solar installed this summer, and I’m using some downtime to experiment with energy automations to optimize my power usage. I already have automations to optimize usage according to hourly electricity price and grid tariffs, but with solar I will have to switch between that and optimizing for using solar. Skill level “can adapt other people’s code to work for me, but not program anything from the start”
Now the challenge is the water heater. It has a thermostat set to 75c, so as long as it gets up to that every couple days I’m safe from salmonella (I’ve done my research on salmonella safety, not taking any chances). I live alone so capacity is not a problem, I can turn it off for a couple of days and not run out of hot water. I have a binary sensor that detects when it’s using power, and the states from the switch and boolean used to control it.
My idea is to make a sensor that detects when the switch is on but it’s not drawing power (meaning it has reached 75c and shut itself off), and detect the time since this last happened. Then I can use the solar control as the main way to control it, and turn on the electricity price control if it did not get up to max temp during the day (price is almost always lowest at night). I should be able to figure out the automations, but I have no idea how to make the sensor code.
TL,DR: Need sensor "time since (state of switch = ‘on’) and (state of binary sensor = ‘off’)
Other ideas a welcome too, this is just the first solution i came up with.
Thanks!