timer-bar-card
timer-bar-card copied to clipboard
[Google Home Alarm] Unable to pull end time
Using Google home integration (Have version that pulls alarms and timers from Google home devices) alarm state has date and time in a format that shows on this card but does not generate a bar.
Right now it shows as 2021-08-30T06:00:00:06-07:00
Alarm is set for 6AM
Thanks for creating the issue!
I don't have a google home, so I don't know much about the integration.
Would you mind posting your configuration and the debug contents (add debug: true
to the configuration).
That will greatly help me debug.
Thanks!
I cant access my debug due to some HACS issues but i can show full attribute info for a alarm to help out with the issue
next_alarm_status: set
alarm_volume: 0.550000011920929
alarms:
- alarm_id: alarm/xxxxxxxx-xxxxxxx-xxxxxx fire_time: 1630886404 local_time: '2021-09-06 00:00:04' local_time_iso: '2021-09-06T00:00:04+00:00' status: set label: null recurrence: null
integration: google_home friendly_name: Kitchen display alarms icon: mdi:alarm-multiple device_class: timestamp
This might be impossible to do without some templating. I notice the state is set to the alarm time which will change every day, so the active_state
option won't work.
You could use guess_mode
so the card can guess whether the alarm is active or not, but the guess mode requires knowing either the start time or both duration and end time. It doesn't look like the alarm supplies either.
If that's correct, the only option now would be to write a template entity whose state is the status
attribute, and use that template entity in the card. You miss out on the card displaying the end time though...
I might have to consider adding some new ways of figuring out whether the alarm is on or off.
Sorry I haven't had time to keep up on this, I could template out the status and end time, then feed that in, just didn't know if there is a cleaner way to do it
Guys, I think I have a suitable question on the topic. I have a sensor like this: 14h 12m
it's possible to use it from start time of my switch turn on to this sensor value above?
It seems to me that I should use the 6th item and take the duration from my sensor, but how to specify its format correctly? Or make an additional sensor where there will be a format like xx: xx: xx?
https://github.com/rianadon/timer-bar-card#6-my-duration-actually-comes-from-another-entity
@SAOPP you are correct. The format for duration needs to be x:x:x
. Supporting any arbitrary time format would be a lot of work so I only support the format Home Assistant timers use.
@gmcaesar sorry the templating is going to be the cleanest way for a while. I don't have the time to add new features to the card anytime in the near future.
@SAOPP you are correct. The format for duration needs to be
x:x:x
. Supporting any arbitrary time format would be a lot of work so I only support the format Home Assistant timers use.
Okay, thanks, I will try.
It's been a while and I can't find a template to make google home alarms work, with a google search least. I did find the template to make the timers work as per the documentation on this integration. Can anyone share their template they used to create an alarm that is compatible with this card?
@morrisonpeter
https://github.com/rianadon/timer-bar-card/issues/19#issuecomment-923650295
It looks like timers and alarms have a bit of different syntax so aren't going to be really compatible.
If I have time this month I might try looking into either making some PRs to have the Google Home integration supply the attributes this card needs to work or writing a version of the card specifically for Google Home stuff. I still don't like how templates are needed to put the Google Home information into the card's format.
@morrisonpeter
This thread started a while ago so there's some newer features in the card that might help:
- The
end_time
can be configured to come from the entity's state. - Since alarms don't really have a "start time", it should be acceptable to only configure
end_time
and let the card use the alarm's date-of-last-modification as its start time. If this doesn't work from you, you can supply a fixed duration to start showing the timer some number of hours before the alarm fires. - Make sure you turn on guess mode
There's one fix I need to make to the card for this to work—I put extra restrictions on guess mode that I realize now are unnecessary. I'll remove them in the next release.
TL;DR use guess_mode: true
and end_time: { state: true }
and you shouldn't need a template