Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make time remaining available for paused timers #842

Open
stefan-sherwood opened this issue Feb 21, 2024 · 0 comments
Open

Make time remaining available for paused timers #842

stefan-sherwood opened this issue Feb 21, 2024 · 0 comments

Comments

@stefan-sherwood
Copy link

Is your feature request related to a problem? Please describe.

When I query a running timer, included is the fire_time field, from which I can subtract the current time to get the time remaining. However, when the timer status is paused the fire_time is null (as expected since the timer isn't running) and there is no other field I can use to determine how much time is left on the timer.

For example:

{
"entity_id": "sensor.home_base_timers",
    "state": "unavailable",
    "attributes": {
        "next_timer_status": "paused",
        "timers": [
            {
                "timer_id": "timer/9bed6d89-3091-43e0-80b4-5180dada71bb",
                "fire_time": null,
                "local_time": null,
                "local_time_iso": null,
                "duration": "0:05:00",
                "status": "paused",
                "label": "test timer"
            }
        ]
    }
}

Describe the solution you'd like

I recommend adding an additional field (e.g. remaining) that indicates how much time is remaining on the timer.

Describe alternatives you've considered

I tried having my program that queries the timer remember the fire_time and when the status changes to paused store the remaining time. This has two problems:

  • by design there is potentially a huge latency between the time a timer changes state and the time that information is available in HA so this strategy can yield wildly inaccurate results
  • if my program starts when there are already paused timers, there is no reference info available to get the time remaining

Additional context

If I go into the official Google Home Android app, I can see the time remaining on all existing timers, regardless of whether or not they are currently running. So I suspect this info is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant