The output of this sensor is 18:30:00.
I would like to get 18:00 instead.
In short, how can I remove seconds? I’ve googled and read the documentation but I can’t figure this out.
On another note, I noticed that the output of this attribute is the next time there is a change of state.
I.e. next slot is at 18:30:00 for half an hour → up until 18:29 the output is 18:30:00, after that the output is 19:00:00.
I would like to catch only the start of the event. So, in my example, after 18:30 I would like to get the starting time of the next event, instead of the end time of the active event. Is this possible to get in some way?
I hope I explained myself
As far as I know, there is not a way to accomplish what you asked about in your second question with the schedule helper, because there’s no way to “skip” to the event after next. The closest approximation I can think of would be to have the sensor’s state return something like “active” while the schedule is on, and only give the time of next event when the schedule is off.
I guess you are right, maybe the Schedule helper wasn’t the best choice in the first place, but I couldn’t think of a better solution.
I’ll try and find a solution, otherwise I will implement yours.
I’m trying a different approach to solve my second question.
Instead of using a scheduler helper I’m using four input_datetime helpers.
Here’s the new template sensor:
This actually works only when the first condition is true, otherwise it always jump to the final else.
Is there something wrong with the “and” boolean inside template sensors?