rianadon / timer-bar-card

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

I just have duration and remaining, is this card right? #56

Closed tbaumann closed 2 years ago

tbaumann commented 2 years ago

Hi,

I only have duration (minutes), remaining (minutes) and a state entry to work with.

There is no really easy way to calculate absolute start or end time. Except to perhaps extract it from the time of the state transition.

Should I look for a different card? Or worth trying to get it to work?

Cheers

tbaumann commented 2 years ago

This works

template:
  - sensor:
      - name: "Rice Cooker Timer"
        unique_id: xiaomi_miio_cooker_timer
        icon: mdi:timer
        state: '{{states("sensor.xiaomi_miio_cooker_mode")}}'
        attributes:
          duration:   '0:{{ states("sensor.xiaomi_miio_cooker_duration") }}:00'
          start_time: "{{ states.sensor.xiaomi_miio_cooker_mode.last_changed }}"
          remaining:  '0:{{ states("sensor.xiaomi_miio_cooker_remaining")}}:00'
type: custom:timer-bar-card
entities:
  - sensor.rice_cooker_timer
active_state: Running
active_icon: mdi:fire
bar_direction: rtl
invert: true
bar_foreground: orange
bar_background: grey

But it would be damn nice if I just had to specify duration: and remaining: entities in the card.

Also, is there any way of getting time remaining displayed in minute granularity instead with seconds?

tbaumann commented 2 years ago

image

tbaumann commented 2 years ago

It worked fantastically. But it randomly stopped image Time Remaining is 0 But attribute remaining says otherwise.

tbaumann commented 2 years ago

Looked pretty nice while it worked. Any idea how to make it reliable?

rianadon commented 2 years ago

I'd try removing start_time. remaining and duration should be enough for the card to figure out how much time is left.

However, that's once I merge #47. I keep forgetting about that.

Good idea with the minute granularity. I'll add that in.

tbaumann commented 2 years ago

Thanks a lot, somehow I thought start_time was required.