Thanks for a great product, home assistant it great and although I am very new to it, I am having lots of fun with it.
I am intergating HS with my solar inverter and are then turning on geysers and pumps depending on available solar power, battery state of charge etc. One thing that I would like to do is to turn off the geyser when when it isn’t drawing any current (assuming that it has reached the desired temperature) and set a flag to not turn on the geyser again for the current day. The automation that starts the devices should then be able to check if this flag has been set and not turn on again for the current day.
I might be missing something but I suspect that ‘helpers’ might be helpfull to achieve this. I haven’t been able to ‘set’ an helper value from automation though.
If the last time the automation triggered was prior to midnight, it will execute the automation’s action. If the automation already triggered today, its last_triggered will be greater than midnight and the condition will prevent execution of the action.
Note
Be advised that this template will fail if the automation is new and has never triggered before (because its last_triggered value will be none). There’s a way to avoid that (by employing the default filter) but I have chosen to exclude it to simplify the template.
I have been able to set the input_number through an action which is exactly what I want becuase the device can be used more than once per day, and only set not to run again for the day under certain conditions. Now I just need to be able to add this check of the input_number to an automation condition to not trigger if this value is 1. I am not sure how to do this.
Which can also be achieved using the technique I mentioned by simply modifying the condition. After all, the technique you have chosen still requires a condition to test the input_number’s value.
Credit goes to Petro who created the function, after musing about a need for it here (August 2021), and then posting an example that employed it without an argument here (October 2021). It wasn’t until December when I found a need for “today at midnight” and have been finding more applications for it ever since.