iorifly
(Renato Barbosa)
September 19, 2018, 10:03pm
1
Dear, I’m trying to create a script that has a condition of execution that is> 25 degrees.
I’ll call the script whenever I get home. My difficulty is in the model I have to do.
trigger:
platform: template
value_template: "{{(states.sensor.sensor.yweather_temperature | float)> 25)}}"
finity
September 19, 2018, 10:12pm
2
Here’s one that I use that works:
trigger:
platform: template
value_template: '{{ states.sensor.ssl_cert_expiry.state | int < 21 }}'
Also be sure to properly format your code when posting things to the forum. See the blue box at the top for instructions.
it helps to see formatting/syntax issues.
1 Like
iorifly
(Renato Barbosa)
September 19, 2018, 10:17pm
3
Thanks for the answer.
But it has to be a non-triggered execution condition.
finity
September 19, 2018, 10:20pm
4
I’m not sure I follow what that means…
Try:
- alias: Whatever
trigger:
# Put your "I got home" trigger here
condition:
condition: numeric_state
entity_id: sensor.yweather_temperature
above: 25
action:
# Put your action(s) here
iorifly
(Renato Barbosa)
September 19, 2018, 10:22pm
6
I want to make a condition. I do not want to trigger …
That is, the scritp will be called. And it will only run if the condition is met. that is, if the temperature is> 25 degrees.
Oh, you want this in a script?
Ok, try this:
script:
my_script:
sequence:
- condition: numeric_state
entity_id: sensor.yweather_temperature
above: 25
- # Additional steps go here
1 Like
iorifly
(Renato Barbosa)
September 19, 2018, 10:42pm
8
boy,
You’re always great. I confess that when posting I was hoping for you to appear.
Thank you! You’re very good at programming.
Thanks. I’ve been doing it for 40 years; I hope I’ve picked up some tricks along the way!
Glad I could help.
1 Like
nickrout
(Nick Rout)
September 20, 2018, 3:11am
10
Thunderbird Two was always reliable!
3 Likes