rianadon / timer-bar-card

A progress bar display for Home Assistant timers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Working with the Traeger Timer

rossc719g opened this issue · comments

Hiya!
I keep trying and failing to get the card to work nicely with the timer on my traeger grill.
(https://github.com/sebirdman/hass_traeger)

The grill device has three separate entities for the timer. For me, they are:

  • number.801f12f10c90_cook_timer
    The duration of the timer in minutes if the timer is set, and 0 otherwise.
    Displays as either "120.0 min" or a slider that I can drag, depending on context.
    Strangely, it only lets me drag from 0 to 100, so... if I want a time longer than 1h 40m, I need to use the traeger app to set it... But that is a problem for another forum.
  • sensor.801f12f10c90_cook_timer_start
    The time (measured in seconds from 1970, when the timer started (or 0 if there is no timer set)
    Displays as: "1,710,214,292 sec"
  • sensor.801f12f10c90_cook_timer_end
    The time (measured in seconds from 1970, when the timer is finished (or 0 if there is no timer set)
    Displays as: "1,710,221,492 sec"

The config I am using looks like this:

  type: custom:timer-bar-card
  debug: true
  entities:
    - entity: number.801f12f10c90_cook_timer
      name: Traeger Timer
      guess_mode: true
      duration:
        state: true
        attribute: "timespan"
        units: minutes
      start_time: 
        entity: sensor.801f12f10c90_cook_timer_start
        units: seconds
        state: true
      end_time: 
        entity: sensor.801f12f10c90_cook_timer_end
        units: seconds
        state: true

When I turn on debug I see:

State: 120.0 (state mode = idle)
Mode: idle (auto mode = N/A, used)
Duration: 7200 second
Time remaining:
Counter:
Attr: {"min":0,"max":100,"step":1,"mode":"auto","attribution":"","integration":"traeger","unit_of_measurement":"min","icon":"mdi:timer","friendly_name":"McGrillFace Cook_timer"}

Any ideas for how to get this sucker working?
Thanks!

The time (measured in seconds from 1970, when the timer started (or 0 if there is no timer set)

That's going to be a problem. The seconds unit only applies to durations and not start/end times. The only supported format for those is the 2021-09-07T20:24:13+00:00 format, since that's fairly standardized across Home Assistant for start & end times.

Your best bet for this would be to write a template, either within Home Assistant or using one of the template card libraries I've linked in the README. Or convince the maintainer of the integration to switch the format to 2021-09-07T20:24:13+00:00 like most other integrations do it. I do try to use the little influence I have from this card to force standardization when possible :)

The time (measured in seconds from 1970, when the timer started (or 0 if there is no timer set)

That's going to be a problem.

Well, I'm a little relieved that it was not user error. I tried for so long. 😭

Your best bet for this would be to write a template

I'll see what I can do there.

Or convince the maintainer of the integration to switch the format

I considered this route (also to address the 0-100 slider), but it seems like the integration is not being actively maintained right now, based on what I saw in the issues for it. I think a few people offered to fork and maintain it, but it seems to be in limbo right now.

I do try to use the little influence I have from this card to force standardization when possible :)

I'm betting that it'll fall on deaf ears in this case.. but you could certainly try. Perhaps one of the prospective new-owners might listen?

Thanks!

Well, I'm a little relieved that it was not user error. I tried for so long. 😭

Ahh I'm sorry. It is tricky that start_time and end_time support all the things that duration and remain_time do with the exception of units.

I'm betting that it'll fall on deaf ears in this case.. but you could certainly try. Perhaps one of the prospective new-owners might listen?

It does look like there are some prospective new owners looking to merge in the outstanding PRs. Maybe once the "official" fork is figured out or the ownership is transferred would be a good time to send in an issue/PR.

For writing the template, there are plenty of examples in the issues in this repo. I think the as_datetime(timestamp).isoformat() should convert the timestamp to the format the card expects.

I haven't had a chance to try the template approach yet, but it seems like one of those things that will work eventually if I have a few hours to try on it. Templates can do pretty much anything.. ... eventually. :-)

It is tricky that start_time and end_time support all the things that duration and remain_time do with the exception of units.

Interesting. Is there a reason for this? Or could that be added without too much pain?

And along similar lines... Have you had any luck using the meater timers?
https://www.home-assistant.io/integrations/meater/

They show up in the dashboard as more sensible things like "start time: xx MInutes ago" or "in 2 hours" etc..
Just curious if someone else had already done the legwork to make them work?