Hi,
i finally have done a simple SINGLE On/Of Automation based on Sun.
alias: Nachtbeleuchtung v2.1
description: ''
trigger:
- platform: sun
event: sunset
offset: '-00:30:00'
- platform: sun
event: sunrise
offset: '+00:30:00'
condition: []
action:
- if:
- condition: template
value_template: '{{states(''input_number.nachtbeleuchtung_status'') | float >0}}'
then:
- service: script.nachtbeleuchtung_aus
data: {}
else:
- service: script.nachtbeleuchtung_ein
data: {}
mode: single
What i would to get rid of (better readable): The value_template part. Is there no way to directy check for value of an input field?
background:
The script for turning the lights off, which is called by the automation, is setting the nubmer 0 to a input field. The other one for tunring on the lights is setting the number 1 into the field.
Maybe there is a complete different way to make scripts like that, because i do not want to maintain 2 scripts for the same thing (One for turning lights on and one for turning lights off)
I just want to get better by time