I am trying to create a simple automation to turn on a fan if the temp matches a value I want to set in the frontend.
It looks like I would use a input_number or input_select to set the value
I want the fan to come on at say 72
I already have a automation working but I have to hard code 72 and that
can change.
How do I set the value from 70-80 and pick it in the front end
and then have my automation run if it’s above that temp.
Here is my automation with the value hard coded
#----------------------------------------------
#----Turn on Fans if Indoor temp above 72
- id: fourteen
alias: "Turn On Fans if Indoor Temp Above 72"
initial_state: 'on'
trigger:
- platform: numeric_state
entity_id: sensor.visonic_mct340_e_0b3e48b5_1_1026
above: '72'
condition:
condition: state
entity_id: device_tracker.samsungsmg935v
state: 'home'
action:
- service: tts.google_say
entity_id: media_player.ccaudio_kitchen
data_template:
message: >
Inside temp warming up. Time to turn on box fan's
- service: switch.turn_on
entity_id:
- switch.wemo_mini_kitchen
- service: switch.turn_on
entity_id:
- switch.wemo_switch_1
- service: switch.turn_on
entity_id:
- switch.wemo_mini_entry
I am having a hard time with passing variables in Hassio.
Any help would be great.
Everything is working now.
Got the template to fire true in the editor but it still was not working
I had changed my code and cleaned it up as you suggested was this
But it would not work.
Then I noticed you had me change from
switch.turn_on to homeassistant.turn_on
When I changed it back to switch.turn_on everything worked great.
Any reasons why you suggested homeassistant.turn_on instead?
switch.turn_on can only turn on switches, homeassistant.turn_on can turn on anything, so if you decide to add a light or a media player or a scene to the automation you can just tac them on the end if you use homeassistant.
Doesn’t make sense that it wouldn’t work with homeassistant.turn_on as your service.
Just changed it back to homeassistant.turn_on and it works fine now.
Must have had a spelling error or something, nice to know that works
for everything, makes doing multiple things much easier.