Custom voice command and response (e.g. with Google or Alexa)?

Hi all,

not sure where to ask this question and how to search for similar questions.

I am using the latest google home binding in combination with myopenhab.org
Unfortunately it seems this integration is limited to smart home devices, like lamps that can be turned on or be dimmed.

Is there any way to use custom voice commands like “what’s the current status of my backup?” and then a rule in openhab will run a script to get the response, which will be fed back via voice (e.g. using say())?

btw: I know this is possible with IFTTT. Any other way without using an additional cloud service?

Stefan

As I understand it, both Google Home and Amazon Alexa skills act as “smarthome” to avoid having starting the respected skill and then asking questions, but you’re able to say direct commands. But you’re limited to actual smarthome applicances like Switches, Lights, HVACs and so on…
So my guess is, it won’t be from the nature of smarthome-skills to use them as a “plain” conversational agent.

But - you could with a bit workaround use this presently, if you combine a proxy item with smarthome tagging and use that as a trigger:

  1. a switch item for “status backup”
  2. if you “Alexa, turn status backup ON”, your desired rule with say() starts
  3. if you use the expire-binding, you can automatically set the Switch Status to OFF again

if you’d like to have a chatbot Interface (with speech but in a App), you could use habot:

1 Like

this sounds very interesting but unfortunately cannot be triggered via voice (google/alexa), right?

nope. habot is an WebApp only as far as I see it.

You either have to use proxy items with the existing skills for Google home / Amazon Alexa - or write your own skill! :wink:

If you are crafty you can do something like this: [WIP] Google AIY Voice with openHAB. However, the custom commands will only work through the AIY, not when interacting with Google Assistant on your phone. There are equivalent ways to do something similar with Alexa on an RPi.

There is a beta AmazonEchoControl binding which can speak a reminder message. According to the link “Some ideas what you can do in your home […]: Remind you with a voice message, that a window is open for a long time and it is winter

I haven’t tried it yet but this might be what you are looking for.

Hi all, lots has moved forward since the last suggestion. I think the approach for having a custom voice command and response via Google or Alexa using a proxy item is quite simple.
BUT: is there a way to have e.g. an Alexa Skill programmed individually that can be (a) invoked by openhab that (b) asks a question and depending on the outcome can © trigger some openhab events / items? Any idea? Think that would be a nice Use Case for home automation

Any updates in this area?

not 100% sure if it is what you are looking for but…

you can define a custom phrase that Alexa will detect in the app.
you can then use a rule that detects LastVoiceCommand changes
and use the Echo Control Binding to speak responses

we use a combination of which Alexa ‘heard’ the command and what the command is to trigger rules such as ‘Alexa, I’m leaving’

1 Like

What? I don’t get it