AWESOME!
I was thinking just using the outside temp from the built in weather entity?
So like weather forecast for the day, and once it reaches 20c outside as per the weather entity, and then turn off the fan again once it hits like 15c outside.
Basically I have a smart plug controlling some fans and an extractor for my loft where my server rack is.
I dont want the fan going 24/7, and I also dont want to control it manually. Right now its Winter in the UK so there is no need for it to be running.
But in Summer only really on the days where the loft warms up do I want it to run. In the evenings it generally cools down enough to not be needed again.
Hence the reason I want it to turn itself back off.
Hopefully this makes sense and helps explain it?
And thank you so much again.
It turns on a switch (you smart plug), if temperature is above 20 and off otherwise. Since the automation only triggers on passing the thresholds 15/20, the switch will stay unchanged if temperature is between 15-20.
Replace <your-weather-entity> and <your-plug-entity> with appropriate values, of course.
alias: Fan Control
description: 'Turns plug on, if temperature is above 20°C, off otherwise'
mode: single
trigger:
- platform: numeric_state
entity_id: weather.<your-weather-entity>
attribute: temperature
above: '20'
- platform: numeric_state
entity_id: weather.<your-weather-entity>
attribute: temperature
below: '15'
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: weather.<your-weather-entity>
attribute: temperature
above: '20'
sequence:
- service: switch.turn_on
data: {}
entity_id: switch.<your-plug-entity>
default:
- service: switch.turn_off
data: {}
entity_id: switch.<your-plug-entity>