Pretty new to HA and have been getting stuck trying to figure out how to set up a specific automation. Basically i’m looking to trigger some device actions and scripts at 7:00 AM if the outdoor temperature is over 70 degrees. Any help would be appreciated!
Add an automation, choose “Time” as trigger.
Trigger: Time
Time: 07:00:00
Then, add a condition, so that the automation only executes the action when the condition is met:
Condition: Numeric state
Entity: (your temperature sensor)
Above: 70
Then add the actions.
If you don’t have a temperature sensor, you can get one pretty cheap, or you can use some cloud integration like met.no (might already be active)
Since this gives you a weather object, you need to extract the temperature from the attributes.
Sounds harder than it is!
For your automation condition, choose the weather provider as the entity (like weather.home)
Again, use Above: 70
Now you need a value template to get the temperature out of the weather entity: {{ state_attr('weather.home', 'temperature') }}
It then checks the condition to ensure the temperature is above 70. If its above it will continue to the action, if below it stops the automation.
The action then turns on a switch with entity_id switch.exampleswitch
You will need to adjust the above to work with your weather platform and the actual action you want to take place.
The dev tools are super helpful in looking at your entity IDs and the assoiated attributes. You can also test templates real time to ensure they work correctly and render the correct output. True = proceed with the action; False = stop on the output of a template in a condition.
Looks beautiful (other than the light theme )
Yes, you needed to change the Entity, that’s right
As for the actions; you already said you’re fairly new here (welcome again!), so a small heads up for the actions, because you wrote about a device action: Some physical devices won’t show up as a device.
Instead, please take a look at https://www.home-assistant.io/docs/scripts/service-calls/
For example, use the service “light.turn_on” to turn on a lamp, you can add parameters like the brightness if the device supports it. Take a look at the Developer Tools -> Services for the available ones. Also you might want to bookmark Integrations, there is a lot of great information there about each integration
Have fun!
Yeah, sad that it gets taken down, still worthy of note though, don’t think building a lot of stuff on sth. that has a set expiry date is the best solution.
I’ve actually been learning a lot over the past week or so and I’ve gotten a lot of stuff set up outside of automations. I set up the rest of that automation and tested it and everything is working. Thanks again for all the help!