Hi everybody,
I am trying to create a rule that will turn off devices / groups at a particular time (regardless of sun, presence, etc.; if it is time x, turn them all off). However, I want people to be able to edit this time when logged in rather than manually doing so in my .yaml
files.
input_datetime:
only_time:
name: "Uhrzeit Abends"
has_date: false
has_time: true
icon: mdi:clock
This creates states.inpuit_datetime.only_time
. I can query the set value in templates via {{ states.input_datetime.only_time.attributes.hour}}:{{ states.input_datetime.only_time.attributes.minute}}
(which will return 20:15
in this case.
I then added
- id: 'abends0001'
alias: "Abends Geräte ausschalten"
trigger:
platform: time
value: > # tried countless variations of this, this is just the most recent one
"{{states.input_datetime.only_time}}"
# at: '18:00:00'
condition: []
action:
- service: switch.turn_on
entity_id: group.abends
I also tried value_template
, but that did also not work.
So basically, this value will most likely not change very often. However, it would still be nice to have the ability to do so on the go rather than having a hard-coded value that I could still edit on the go (vpn => ssh => vim), but not as comfortably. This attempt should create an input box to set a certain time (which it did!) and then use that value for the automation (which I cannot figure out how to do).
Is this possible, and if so, what should I read up on to understand what I should change?
Thanks in advance for your help!