Android shortcut to HA script?

Hi folks,

is it possible to create some kind of “one-click” solution to trigger a HA script? Some kind of widget shortcut that directly executes the routine?

Eg in the morning, I just want to tap a single button on my smartphone (I don’t own a google home mini device or stuff like that), which calls a script to open the blinds, turn the light on and start radio playing.
But I’d like to prevent having to open the HA app/dashboard, look for the correct button and press it. I’d prefer adding something to my homescreen.

Or even better telling google with “ok google, start my morning routine”. Can I trigger a HA script within my local wifi from an “ok google” voice command (without having to expose my HA to the open web)?

I already thought of IFTTT, but this probably requires a web port exposing HA. So not possible. Or maybe with tasker? I don’t know which direction to look at.

The official HomeAssistant Companion app supports widgets that call a service directly per the docs

I would prefer “ok google, start my morning routine”. Is that possible without HA in the cloud?

You could set up an input_boolean as a switch in Google Home and then set up your routine so it turns the switch on and then off. In Home Assistant you can have the input-boolean trigger an automation when its state changes from ‘off’ to ‘on’.

I explicit asked for a solution that does not require cloud nor exposing HA to the public internet.
I’m looking for a local solution only.

And how can I do this? As written I only have google assistant on my android smartphone. I do not own a google home device.

Then why are you using Google?? Google isn’t local.

Well when I’m at home, I want to say “google, do this and that”, and this should trigger HA scripts. Locally. As I cannot expose the HA port to the web, neither would I register for a paid cloud…

I you want, I’m looking for the “alexa echo -> emulate_hue” way, but with google assistant on my smartphone.

Set up Google Assistant as per the docs, you don’t need to use the Cloud Service. Google Assistant runs on your android phone. When you expose entities from Home Assistant to your Google Assistant, you’ll be able to control them from your phone with the Google Home app (voice and by tapping inside the app).

And how can I actually expose entities from HA to GA and make it discover them?
Eg for alexa with emulate_hue, I can add the Hue Hub in Alexa Echo.

But how for google?

Newsflash: Google doesn’t do “local”. Google Assistant REQUIRES the internet, and cannot communicate locally with your Home Assistant.

Why not?

OK.

No web, because I have a very bad IPv6 ISP. Plus security concerns. I’d rather not going to implement this, before exposing a web port.

Then cloud is your only option to use Google Assistant with Home Assistant.

You’re right I should’ve been more clear. Obviously Google Assistant is still going to be using their own cloud service, it’s not going to happen locally but in the integration there’s two different types and one is configurable very easily of you have Home Assistant cloud service. I’m just saying you can use the other method :+1:

If you’re adamant about keeping it 100% local, you can use Tasker and Autovoice to send API calls to the local IP of your HA instance. You just can’t use Google Assistant.

Well but with “Home Assistant cloud service” you mean the paid cloud? If so, as written I won’t go for it…

Why? You don’t like to help support the project you are using?

As for now it’s just a pet project, and I don’t know if it will be growing or run out in about half a year.
Plus, and which is my major concern. I won’t be exposing anything into a cloud for security. No matter which cloud it is. As eg my doors are controlled with smart locks, the risk is too high for me.

I will have a look into tasker autovoice then.

I remember reading something about the Almond add-on as well. I looked and it’s description is ‘The Open, Privacy-Preserving Virtual Assistant’. I’m not sure of the details but could be worth investigating.