Hi,
this has been discussed (and solved) with a workaround (here, and in other threads as well). The solution is usually to use a template sensor
that will check whether the set value is equal to now()
or similar.
I have been using this for quite some time; actually it was in my yamls for so long, that I forgot how to do it now that I need it again. The solution above work fine!! But just out of curiosity, would there be a downside (programming wise, or just in general) to have something similar to this?
input_datetime:
my_time:
has_date: false
has_time: true
initial: "20:10:23"
automation:
- alias: "Time Trigger"
trigger:
- platform: time
# perhaps value_template here?
at: " {{ states('input_datetime.my_time') }}"
action:
# ...
I use templates quite often, and while my way of writing them usually works, working with anything time-related is always a bit more difficult to me than other things. Please don’t get me wrong, I am not asking to change the ways just because I don’t understand how to handle time values But I do think that this makes sense. It would be way easier to quickly create a time-based automation that can be modified without changing your code (just by changing the input_datetime
value in lovelace; I use custom:time-picker-card
for this).
So for now, I’ll just copy my working code, that is similar to what has been posted in the thread I linked above. Still, just suggesting this because I (from a non-programmer standpoint) think that it would be sensible.
Thank you for your feedback