Solution to track your google home alarms and timers and trigger different home assistant events

Nobody?
I’m thinking about a trigger:

  • if alarm is put off

condition:
alarm set on device x

then turn on script

Not sure if thats possible

1 Like

Nobody? any idea?
Is this topic dead?
@Ilja_Leiko any idea?

1 Like

So by default it takes 180 secs to sync changes, so you’ll be able to see it only after that time. Then, it might be the integration is not capable to retrieve the device status, as this keeps happening for one of the 2 Home mini I have. One of them seems to (pretty much) always work fine, the other fine is always unreachable. This morning I discovered it was the opposite, so it’s so random and annoying I’ve never been able to figure it out so I just gave up for now. The integration is there and installed, lovelace cards too but I’m not using it.

I am also trying to turn on the bedroom light after the alarm goes off but couldn’t catch that in HA. Probably because it takes 3 minutes for it to update HA. So, if I am getting it right, the only way is to get the alarms that are set and do a time match with HA time and trigger the automation. But to me, this seems to be unnecessary processing of comparing time. Has anybody done good automation based on alarm status?

Here’s my automation, as you said, doing time match is the only thing working :slight_smile: The 3 minutes to update , doesnt play a role there since i dont put alarms for time less than 3 minutes :slight_smile: lol

- id: 'Google Home alarm'
  alias: 'GH Alarm trigger'
  trigger:
  - platform: time
    at: sensor.wekker_alarms
  condition: []
  action:
  #Do you actions / sripts
  - entity_id: light.nachtlampje
    service: light.turn_on
    data:
      brightness_pct: 80
      transition: 200
  - delay: 00:00:10
  - service: script.turn_on 
    target:
      entity_id: script.google_home_say
    data:
      variables:
        tts_message: "Goeiemorgen ! Tijd om rustig op te staan."
        tts_target: media_player.slaapkamer
        tts_volume: 0.10
  - delay: 00:02:00
  - entity_id: light.nachtlampje
    service: light.turn_off 
  mode: single  

Is this something new that it takes three minutes to update?
I remember being able to set a timer on 20 seconds and it was updated in HA before it rang.

It seems update_entity works to force an update, so I guess that could be a workaround.

1 Like

You can adjust the update yourself in the integration page:

With version 1.6 we have changed the update interval from 10 seconds to 180 seconds. This is due to #202. Some people are experiencing devices timing out when trying to fetch data from them.

You can manually change the update interval by pressing the configure button on the integration page. Default is 180 seconds. Change this at your own risk! If your devices are timing out, please increase this until it is stable again.

Trying to set this up in a second instance, but i must be doing something wrong…
I added the app in the google account
Then added the integration, all good, but i dont see any devices…

Trying to set it up at my friends house, and he has no entities either.
How did you solve it?
Theres nothing special in the network and i enable mdns in his network

Do you have an delay of the automation, because of the different internal time check or time state. I do have a slide delay of 4 sec in this automation

trigger:
  - platform: template
    value_template: "{{ now() >= states('sensor.wohnzimmer_timers')|as_datetime }}"
condition: []
action:
  - device_id: 659d836acf7ea85d3c6470907bc9d72a
    domain: light
    entity_id: light.deckenleuchte
    type: flash
mode: single

and 1.5 sec in this automation

trigger:
  - platform: time
    at: sensor.wohnzimmer_timers
condition: []
action:
  - service: notify.marceltelegram
    data:
      message: Test
mode: single

Is there a way to set the trigger time 10 sec before it the server time?

Is it possible to flag a google device to be ignored? I have several devices found by the integration, but I’m only interested in one.

Hi. I am trying to use the UI to set an automation that fires when one of the Google home hub alarms goes off. I use the time platform and set it equal to the sensor that maps to the display I am using.

Here’s what the developer tools says the state of the sensor is:

next_alarm_status: set
alarm_volume: 72
alarms:
  - alarm_id: alarm/96f2f1d2-3ce1-4334-ad76-86d666fb37b0
    fire_time: 1690486200
    local_time: '2023-07-27 12:30:00'
    local_time_iso: '2023-07-27T12:30:00-07:00'
    status: set
    label: null
    recurrence: null
device_class: timestamp
icon: mdi:alarm-multiple
friendly_name:  Office display alarms

But this does not fire the trigger, at least in 2023.7.3. Any ideas?

Do you have an updated version of this? Never got it to work for me tbh but the timers do show up in HA.

I was able to start a timer in a google NEST using an Alexa templated command for a variable time (ie washing machine remaining time), then i was able to use a template a sensor with the HACs integration and stop the timer, it is a bit clumsy, so I was wondering if it’s possible to pass an analog or numeric helper along with a toggle helper to google and then start an automation in google home that templates or reads that value for the specific amount of time. Just need to know if it’s possible or if anybody has done it as I havent really done anythign with the google scripts automation.

I have a question on how to get the alarm ID without going into HA manually to pull it in order to delete alarms. What I’m trying to do is to delete an alarm if I’ve woken up before it goes off. I have a routine that runs when I get up, and that works. What I’m trying to figure out is how to pass the alarm-id from the sensor back to the service to delete the alarm. There is only one alarm set for the device. And I can see the alarm in HA and I’ve been able t delete it when trying with the developer tools. Just missing that last piece to connect the two. Fairly new to HA here, so forgive me if this is obvious to everyone but I’ve been looking around for a couple hours now and I’m not any closer than when I started. Thanks a bunch!

Okay…I guess I should have waited an addition hour to post because I did find it. Next time I’ll search for four hours but part of me is convinced that I only found it because I did post the question. :upside_down_face:
If anyone else finds this wondering, in the alarm id use:
“{{states.sensor.device_alarms.attributes.alarms[0].alarm_id}}”
Worked like a charm.

2 Likes

I want to just show the time of the next alarm… but how do i set that local time attribute (preferably in an nice annotation)