frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Tile card not updating the "remaining" (time) when using timers

Open moonwhaler opened this issue 1 year ago • 7 comments

Checklist

  • [X] I have updated to the latest available Home Assistant version.
  • [X] I have cleared the cache of my browser.
  • [X] I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

After setting up a tile card for a "timer" in the dashboard, the "state content" attribute "remaining" never gets updated in the tile card. Clicking the tile card brings up a dialogue which displays the remaining just fine - and also updates it as time moves along.

Describe the behavior you expected

The remaining time should be updated in the tile card until the timer is up.

Steps to reproduce the issue

  1. Add a tile card to a dashboard
  2. Use a timer as the entity
  3. Select "remaining" in the "state content"
  4. Save
  5. Start the timer ...

What version of Home Assistant Core has the issue?

2023.11.2

What was the last working version of Home Assistant Core?

2023.11.2

In which browser are you experiencing the issue with?

Firefox 119.01

Which operating system are you using to run this browser?

macOS Sonoma 14.0

State of relevant entities

entity: timer.kuche_kochmodus
duration: 0:30:00
editable: true
restore: true
icon: mdi:timer
friendly_name: Küche: Kochmodus

Problem-relevant frontend configuration

type: vertical-stack
cards:
  - features:
      - type: light-brightness
      - type: light-color-temp
    type: tile
    entity: light.hangelampe_kuche
    icon: mdi:ceiling-light
    name: Hängelampe
    tap_action:
      action: more-info
    hide_state: true
  - features:
      - type: light-brightness
    type: tile
    show_entity_picture: false
    vertical: false
    entity: light.zigbee_tradfri_driver_03
    icon: mdi:faucet
    name: Küchenzeile
    hide_state: true
  - type: horizontal-stack
    cards:
      - type: tile
        entity: sensor.zigbee_aqara_motion_03_device_temperature
        name: Temperatur
        color: accent
      - type: tile
        entity: timer.kuche_kochmodus
        name: Kochmodus
        state_content: remaining
  - type: media-control
    entity: media_player.wohnzimmer

Javascript errors shown in your browser console/inspector

No response

Additional information

Bildschirmfoto 2023-11-11 um 22 13 52

moonwhaler avatar Nov 11 '23 21:11 moonwhaler

I'll argue this isn't really a bug, but just a quirk of how the remaining attribute works for timer, which is pretty unintuitive.

It is not an accurate count of the time remaining, as it only updates when the timer changes state (like changes from running to paused). It does not continually update as it counts down, as that would generate a lot of unnecessary recorder events.

So the tile card is correct in showing this attribute as it really exists in the state machine. Some other frontend cards (like entities) do generate a live countdown, but that's not the same thing as displaying the remaining attribute.

One could ask for tile card to generate a similar countdown, but that's more of a feature request.

karwosts avatar Nov 15 '23 02:11 karwosts

I understand your standpoint.

I think there are two ways to look at this: from the perspective of a user this looks like "bad design" as it doesn't act like the name and setting might imply. (Remember I am able to select "remaining" here and it doesn't do anything at all except displaying the "duration", but nothing else).

From a programmers perspective the solution itself works (although I only can image how the inner workings are - maybe it's "one solution fits all", which might be clean in itself, but takes casualities as the programming doesn't cover edge cases like "remaining"). Adding code (or recorder events, as you wrote) makes it more complicated, bloated and maybe error prone.

moonwhaler avatar Nov 15 '23 22:11 moonwhaler

Keen to follow this as I'm using the tile card to monitor the timer state (and hopefully remaining time) but the remaining, as described, stays at the initial value as of the state change from Idle to Active. The workaround for now is I click in to the tile for more details and the remaining time is visible there.

BlackCatPeanut avatar Nov 21 '23 13:11 BlackCatPeanut

I thought I would share that the Entities Card does show the remaining time for Timers when the state moves away from Idle:

image

BlackCatPeanut avatar Nov 21 '23 15:11 BlackCatPeanut

Thank you. Good to know there are alternatives, yet I like a visual consistency thus I am using a lot of tile cards in my dashboards. Would be great to see a similar functionality (as in entity cards) here as well.

moonwhaler avatar Nov 21 '23 15:11 moonwhaler

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 19 '24 16:02 github-actions[bot]

The issue is still unsolved

hbothmer avatar Feb 24 '24 17:02 hbothmer