Issue commands to GA?

I’m trying to find a way to issue a command from OpenHAB (or Alexa!) TO GA.
I am switching to Alexa to be able to fully use the blink camera system I recently picked up but the Alexa nest skill does not support my nest guard security. (Yes this is redundant security - blink was way cheaper cameras than nest and I already had the nest guard since 2018)
I tried using a virtual switch in OpenHAB linked to both but apparently, OpenHAB lights/switches don’t qualify to start GA routines. Home Assistant has the “assistant relay” skill but I have found nothing similar for OpenHAB and don’t really feel this is worth switching platforms.

As far as I’m aware, there’s no way to do that. GA is meant for voice interactions, not for routing commands from one device to another. So, the routines can only be triggered by voice, through the app, or using the home/away functions.

Google recently added “device triggers” for routines so a connected device can trigger a routine (turning on a light starts a good morning routine for example). Unfortunately, the lights/switches/etc in OpenHAB do not show up as starters. Assistant relay can run a command but it has not been updated and does not seem to have a binding for OH only for HA.

I swear to god that when I noticed this I almost had a fit of rage…

1 Like

Interesting. The only options I see for starters in GA routines are:

  • When I say to Google Assistant
  • At a specific time
  • At sunrise or sunset
  • When an alarm is dismissed

But it could just be that the update hasn’t rolled out to me yet.

Which is odd itself as the rollout started over a month ago and I have had the option for almost a month.

Ah, right yes. Took me weeks as well. Did you enroll into the beta app version? I think they are connected.
Click in the settings cogwheel (next to routines) and you should have a new option called public preview. After some time you’ll have the option to enroll and eventually you’ll be notified they youve been accepted. By then you should have the new triggers.

I’m in Canada, and we’re often a little behind the US rollout due to the need for bilingual services/packaging. Can’t say I’m too concerned about it, as I don’t need/want GA to do any heavy lifting for me. I just treat it like a UI and centralize everything in openHAB.

I’m in the US and I still only have the four options. No device trigger.

It must be a beta app feature for now.

They likely changed the API and the Switches need a different GA tag. What do you have the Item tagged as to expose it to GA (i.e. the ga metadata)? Did you try “scene”?

See OrangeAssist - Google Assistant Integration

@michikrug , do you have any insight into this?

I tried scene and GA won’t even pick it up. It will show up in GA as a switch or a light but neither will show up in the device starters.

I’m not showing to be on the preview or beta app but I may be checking in the wrong location. I am running home app version 2.60.1.22 .

I am pretty sure this is related to the fact that openhab devices do not actively notify Google about their state, which would be a requirement for such an functionality.

This limitation comes by design and we can currently do nothing about it.

I got an email from Google about the new Google Home app, and now I can see the “When a device does something” option.

Oddly, they removed “When an alarm is dismissed”. I figured they had added it to the new option, but nope. Unless I just can’t find it, it’s just gone. Not like I was using it anyway, but still…classic Google. :wink:

Now that I can see it, there’s a relatively simple workaround for passing a command to Google Assistant. They’ve added the ability to trigger a routine based on a Google/Nest device’s volume being set between a range. So:

  1. Create a routine that triggers on a Cast device’s volume being set to a specific value. Let’s say 8% (it’ll be better to use a low volume than a high one).
    • You can set the volume range in the trigger to be exact by making both the minimum and maximum 8%.
  2. Use the Chromecast binding to send a command to that device that sets the volume to 8%.
  3. Change the volume back to whatever your normal default is, either through an openHAB command or in the GA routine you’ve just triggered.

I tested this and Google fired the routine in about 5-10 seconds.

If you have a Chromecast, you can also trigger on media changes or on/off state. But for now, I think it makes more sense to use the volume since you can isolate a value that you’ll never ever use.

The reason I say “for now” is that this is only going to work until Google decides it’s silly to start routines based on volume changes and removes the trigger. You know it and I know it.

If you have an old Chromecast that you’re not using, you could use it purely as a bridge for sending commands to Google Assistant. Then you’d have 100 triggers and wouldn’t need to worry about the volume. For now.

1 Like

That’s ingenious!

Kind of slow but still supports lots of use cases.

Kludges are my speciality. I leave the questions that require actual technical knowledge to others, or oversimplify and wait for someone to correct me.

Admittedly, I tested it once and then guessed at it taking 5-10 seconds when I wrote the post. It may have been faster, but there was definitely a lag. I imagine it will generally fall somewhere around this mark.

I could see this being used to start casting an Internet source to a device. I play a radio station every morning when my SleepAsAndroid alarm goes off, but I had to dig out the .aac URL from the website so that I could call it directly in openHAB. This would be much easier.

I could also see this being useful to turn on a TV and display a security camera when someone approaches the house. I imagine that the Nest Cam can do that directly, but Blink and other vendors probably can’t.

I’m still trying to think of reasons why Google added this feature. I wonder if it’s because they had to disable volume control for cast groups due to the Sonos lawsuit, forcing users to individually adjust volumes. This would sort of be a workaround.

It’s supposed to :angry: My Nest account has been mucked up since the switch over to the Google Account. None of my Nest devices appear in Google Home. :sob: Maybe this new app will work, but after working with tech support it sounds like the problem is on the server side, not the client side.

If it is something worth adding to openHAB that many would like to have, then please make a feature request and if you can, provide detail in how it works so that it can be added.