rianadon / timer-bar-card

A progress bar display for Home Assistant timers
Other
364 stars 15 forks source link

Exceeded time with fixed duration #29

Open Mincka opened 2 years ago

Mincka commented 2 years ago

Hello, Thanks for this great card. :) I would like to know if it would be possible to do both things: 1) Count up (or show the total elapsed time) once the countdown of fixed duration is elapsed 2) Continue to add up color in the progress bar, corresponding to the exceeded time

My use case is the following: I have a dumb washing machine and currently I know with a smart power plug when it's working or not based on power usage. I use the time-bar-card to show an estimated progress based on a fixed duration. If the time is exceeded, the progress bar disappear and it just shows "On".

I would like the progress bar default color to shrink and continue to add another color, e.g. red to represent the exceeded time. If the washing machine is on for 2 hours (instead of 1), the bar would be half blue, half red to show to excess percentage. In the meantime, instead of showing a countdown timer, the timer would count up (either from 0 or from the original time + the exceeded time). In my example, it would be either "+1h00" or "2h00".

My current configuration:

type: custom:timer-bar-card
entities:
  - entity: binary_sensor.template_buanderie_lavelinge_running
    duration:
      fixed: '1:00:00'
rianadon commented 2 years ago

Hi! Sorry I've been a bit busy as of late and won't be able to get to updating the card for a while.

However, I love the idea and think it would be a great addition! I'll mark this with a help wanted label for now in case anyone wants to submit a PR.