timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

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

Open tbaumann opened this issue 1 year ago • 4 comments

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 avatar Aug 10 '22 19:08 tbaumann

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 avatar Aug 10 '22 20:08 tbaumann

image

tbaumann avatar Aug 10 '22 20:08 tbaumann

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

tbaumann avatar Aug 10 '22 21:08 tbaumann

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

tbaumann avatar Aug 11 '22 16:08 tbaumann

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.

rianadon avatar Aug 15 '22 06:08 rianadon

Thanks a lot, somehow I thought start_time was required.

tbaumann avatar Aug 17 '22 13:08 tbaumann