I have an input select helper for my washing machine with two options: ‘done’ and ‘busy’. An automation checks the power consumption and sets the helper to ‘busy’ when the machine is on.
Now, I want to display the time in HH:MM format on my dashboard from the moment the washing machine’s input helper is set to ‘busy’.
Bonus question: I want this time display to appear on my dashboard only when the input select is ‘busy’. There’s no need to show the start time when it’s not running.
Currently, my template sensor is:
{{ relative_time(states.input_select.wasmachine_programma.last_changed) }}
This results in displays like ‘6 minutes’, ‘1 hour’, or ‘2 hours’ for 90+ minutes of running time.
I would prefer to see the actual time elapsed, not ‘1 hour’ but ‘1:32’, for example.
It seemed like a straightforward question and task, but I’ve been struggling with it for longer than I’d care to admit.
Odd, I still wouldn’t rely on that as findall doesn’t naturally turn objects into strings. I would consider that subject to change at any time. Especially seeing how most methods don’t do this and require a default value.
thanks for your input.
I now have a counter that counts up with HH:MM.
now for the second part of this quest, i want it only to count if the machine going from status ‘done’ to ‘busy’. when last_changes is from busy to done there is no need to count. is that possible?