Using Google Assistant and Conversational Actions with openHAB

Is there a way to configure conversations using Google Home with openHAB?
Examples:

  • When entering the kitchen in the morning I want to get asked by Google Home if it should play music.
  • When entering the livingroom in the evening I want to get asked “What may i do for you?”

Possible answers in a specific timeframe could be:

  • Yes
  • No
  • Play Spotify
  • Play Music
  • Play Netflix
  • Nothing

It is possible to use Google Home to say some text using the Chromecast Audio Sink with commands like

say("What shall i do?", "googletts:deDEWavenetB", "chromecast:chromecast:12343252523525")

In Items you can use the tag ‘ackNeeded’ to get a question “Are you sure?” from Google Assistant and then it waits for an answer YES or NO.

Switch { ga="Lock" [ ackNeeded=true ] }

I would like a similar way of being able to ask the user, wait for an answer and then react to the user’s choice with a rule. This would be a huge benefit and comfort. There are often situations where the user has to decide or select a scene - and natural language would be a lot better than touching the phone or pressing a button.

Here I found some information about conversational actions - but I don’t know how to use it with openHAB.
[Conversational Actions  |  Google Developers](https://Google Conversational Actions)

It looks like Homeassistant has something similar available:

Is this kind of stuff possible or will be possible in openHAB?

In openHAB we have habbot available - is it possible to use habbot using Google Home as mic/speaker to get similar results?

1 Like

To my knowledge, OH does not support this. It definitely does not have any ability for GA and HABot to interact.

But the Home Assistant integration uses webhooks and that approach should work with OH’s REST API as well. It’s all set up on the Google side of things though (even the HA integration has that requirement). It’s not clear if OH could even provide an “out-of-the-box” solution for this.

Note that the ackNeeded is a wholly different API and unrelated to Dialogflow.

However, the big problem I see here, even with Dialogflow, is how to recognize that you’ve entered the room to initiate the dialog. All the examples I saw had the user initiate the dialog by talking to GA, not having GA initiate the dialog.

You could use orange assistant to do any command you can say on GH. If that is a ackNeeded item
you will only hear google say “are you sure you want to do that”

You can setup google routines to do what you want however it won’t initiate the conversation. This is totally handled by google and you can get it to command multiple openHAB items.

You can create a scene item to trigger a rule in openHAB

This is the main problem with home automation is it is extremely hard or expensive to do this. Google uses Presence sensing using your phones gps. So you may be able to trigger a routine when you get home.

I don’t have google initiate a conversation and I don’t want google to ask if I want something. It is a cool gimmick but I stick to “hey google good morning and boil the kettle”

2 Likes

Thank you @rlkoshak and @denominator for your feedback. So conversation is something far away for non developers. I will check out OrangAssist - sounds interesting. Would be cool to be able to use habbot using voice commands and conversations without sending data to Google Assistant. The openHAB app has the option to say commands already - but what was missing was voice control in the room without using a app. OrangeAssist seems like something I was looking for.