Thanks Peter I got both done with help in a parallel post here.
I’m correct to copy/paste your part starting with template:… to a new yaml file and change the ID and include in configuration.yaml.
Don’t i need automation: above it?
Automation Trigger - Home Assistant
Hi ward0,
The short answer is no. You should not add automation above it. These are not automations but template sensors. That get triggered, do an action and then fill a sensor. I cannot find a direct link to template sensor documentation but this is what I used a lot. Templating - Home Assistant
My templates have changed a lot from those in this post. But the basics stayed the same.