Coding noob question that’s hopefully easy for someone not as inept with coding as me lol…
Long story short - I’m using a blueprint in an automation, and for whatever reason the blueprint author defined it to trigger by timestamp sensor. The automation is for a family member who doesn’t have admin so I want to use an input helper to allow the sensor value to be defined from the Lovelace interface.
So here’s my questions:
How do I create a timestamp sensor? I googled and found the help page for sensors but it doesn’t include any YAML examples. Not sure where to start here.
How do set the sensor value to match the value of a datetime input helper every time the input helper is updated?
I see how to modify it but explaining the necessary changes is long-winded (and then you won’t be able to easily accept any of the author’s blueprint updates) so let’s make a Template Sensor based on an input_datetime like you requested.
Will the family member be setting both date and time or just time? In other words, will the input_datetime store date and time or just time?
I have to do exactly what Loric76 was asking in this thread.
My input_datetime contains both date and time, so I’m using your first solution. The thing is that the sensor value stays “Unknown”. I can’t get a way around this.
My guess is that the issue is somewhat related to timestamp, every time I update my input_datetime (both manually and from a script) I find this in the log section:
sensor.ultimo_orario_cibo_gatti rendered timestamp without timezone: 2023-01-04 17:44:36
Do you have any idea on what could I do?
I came here looking for the same solution for the same automation. I implemented the “time only” version above but the sensor still uses datetime format so it has the correct time but the date of when the sensor was last updated so the automation does not trigger.
Is there any way using this template to ensure the automation triggers as it should, at a set time every day?