Closed duckplayz closed 7 months ago
You can use sth like this to trigger the automation
platform: template
value_template: >-
{{ 0 < as_timestamp(now()) - as_timestamp(states("sensor.webuntis_wake_up_time") | as_datetime | as_local) < 60 }}
I simply want to be able to use it in the UI automation creation because I don't really Unterstand the yaml thing. I also plan to use it for some further automations. Isn't there any way to change the sensor yaml so it only shows "6:00:00"?
you can just return the {{ weak_up_time }}
but then it is a text sensor and you canot use it as simple as the datetime sensor.
You can also use the yaml in the ui. Just select template as trigger and input
{{ 0 < as_timestamp(now()) - as_timestamp(states("sensor.webuntis_wake_up_time") | as_datetime | as_local) < 60 }}
So if i use this as a trigger for an automation it will trigger the autmation at the specified time in the sensor template? So if my school starts tomorrow at 7:55 the automation will trigger if its 6:30? Or what do i need to do for that? Sorry if im asking stupid questions but i dont really know much about the yaml thing.
Exactly, the automation will trigger at 6:30
Okay i configured it now and lets hope it works. I simply setup a notification for my phone so i can test if the automation works tomorrow at 6:30! I will report back tomorrow
Hello again, It has worked fine today so Thanks for the help!
Hello, I am pretty new with home assistant and i ran into a problem.
I want to create an Alarm based on the time of the first lesson. For this im using the Sensor template provided in the readme. However the state of the custom sensor is for example "2024-01-31 06:30:00+01:00". I simply want it to be 6:30:00 so i can easily integrate it into a automation. So the sensor should just output for example "6:30:00" or "9:50:00". Is there a way to change that in the Sensor Template?
This is the current state.