Anyone spot something wrong here as it does not work?
- id: ID9
alias: 'Pool Gate Open turn on light'
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d00019fac86
from: 'off'
to: 'on'
condition:
condition: sun
after: sunset
before: sunrise
action:
service: switch.turn_on
entity_id: switch.pool_light
Location and time are set correctly.
Secondly, is there a way inside the automation to turn it off after 1 minute or do I need to write a script to do this first? Any feedback would be appreciated.
Your trigger options are indented too far, and your condition declaration is missing (it’s painful syntax, but you need the declaration for the automation that there is a condition, and then you declare what the condition is, and the keyword for both is ‘condition’) , try this…
- id: ID9
alias: 'Pool Gate Open turn on light'
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d00019fac86
from: 'off'
to: 'on'
condition:
condition: or
conditions:
- condition: sun
before: sunrise
- condition: sun
after: sunset
action:
- service: switch.turn_on
entity_id: switch.pool_light
- delay: 00:01:00
- service: switch.turn_off
entity_id: switch.pool_light
Working on that. Solar pump died and solar panel temp out sensor was reading 99C/210F so just steam was dribbling into the pool!!! Had to wire in the new higher flow rate pump in a hurry yesterday before everything melted! Hope to get onto your code in the next 24/48hrs.
And then adding this to automation but config throws up an error:
- delay '00:{{ states.input_number.timer_delay_slider.state | int }}:00'
When I use the template editor and enter '00:{{ states.input_number.timer_delay_slider.state | int }}:00', it returns a valid number '00:20:00' but the automation does not like it.
Trying this now - delay 00:00:{{ states.input_number.timer_delay_slider.state | int }} which returns the correct value 00:00:20 but the config checker does not like it. Odd, because if I enter - delay 00:00:20, it’s happy.
Thanks, appreciated. It might be real handy for everyone to have something like that (option 1) but for now, I’ll just limit my delay to a max of 59 seconds. Enjoy your day. My bed time!