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

[Google Home Alarm] Unable to pull end time #18

Open
gmcaesar opened this issue Aug 30, 2021 · 14 comments
Open

[Google Home Alarm] Unable to pull end time #18

gmcaesar opened this issue Aug 30, 2021 · 14 comments

Comments

@gmcaesar
Copy link

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

@rianadon
Copy link
Owner

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!

@Frooodle
Copy link

Frooodle commented Sep 5, 2021

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
image
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

@rianadon rianadon changed the title Unable to pull end time [Google Home] Unable to pull end time Sep 6, 2021
@rianadon rianadon changed the title [Google Home] Unable to pull end time [Google Home Alarm] Unable to pull end time Sep 6, 2021
@rianadon
Copy link
Owner

rianadon commented Sep 6, 2021

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.

@gmcaesar
Copy link
Author

gmcaesar commented Sep 6, 2021

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

@SAOPP
Copy link

SAOPP commented Sep 10, 2021

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?

@SAOPP
Copy link

SAOPP commented Sep 10, 2021

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

@rianadon
Copy link
Owner

@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.

@rianadon
Copy link
Owner

@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
Copy link

SAOPP commented Sep 12, 2021

@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.

@morrisonpeter
Copy link

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?

@jazzyisj
Copy link

jazzyisj commented Jul 7, 2022

@rianadon
Copy link
Owner

rianadon commented Jul 9, 2022

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.

@rianadon
Copy link
Owner

@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

@ntk9
Copy link

ntk9 commented Aug 19, 2024

any updae on this ?

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

7 participants