Make openhab ask a question and wait for reply


In my items file I have a switch to turn on / off my mediacenter which I can control from Google Home devices.

It is all working fine, but sometimes my Google Home Mini hears something that for Google Home Mini sounds like turn off mediacenter which is a false trigger. It turns off my mediacenter.

My question: is it possible to make openhab ask a question “do you want me to turn off mediacenter”. If I reply yes then turn off else cancel the turn off?

Switch XBoxMediaCenter "Media Center" <light> (GF_LivingDining) [ "Lighting" ]
Switch XBoxOnOff "XBox power" <light> (GF_LivingDining) {channel="mqtt:topic:9ca7807b:State"}
Switch ProjectorOnOff "Projector power" <light> (GF_LivingDining) {channel="mqtt:topic:4e2046e5:State"} 

My rule

rule "MediaCenter XBox Projector"
when Item XBoxMediaCenter changed 
    if (XBoxOnOff.state == ON) {
        sendCommand(XBoxOnOff, OFF)
    } else {
        sendCommand(XBoxOnOff, ON)

    if (ProjectorOnOff.state == ON) {
        sendCommand(ProjectorOnOff, OFF)
    } else {
        sendCommand(ProjectorOnOff, ON)

I’ve not seen anything like that as an example. I’m not certain it’s possible though. It breaks down at the last step.

  1. GA sends a command to a Proxy Item which triggers a Rule.
  2. The Rule sends a TTS to the GA to ask for the confirmation
  3. GA sends the response to OH which triggers another Rule to actually do the action, or not.

I’ve skipped a lot of book keeping and timers and such but that’s the basic idea. The problem is there is no way I know of to do step 3.


Slightly different than OP but related

This is something I’m also interested in do you know if it’s possible using something else other than Google home?

I think it’s something that’s needed too advance the smarthome/AI feel a more natural two way conversation with the smarthome there are many uses for two way conversations

Me: goodmorning openhab
Oh: Goodmorning Aaron… Would you like me too start some coffee?..
Me: Yes/no…
Oh: OK I won’t make coffee would you like tea instead?

That conversation would be loads better than separate commands good morning & Make coffee ect

You could change the frase to anything else than “turn off mediacenter”. How about, “Xbox mediacenter” ? All you need to do is to change the label of the item.

I know some people have managed two way type stuff using Telegram but I don’t know the details. I suspect if you were using something custom like a Google AIY or Orange Assistant or Mycroft or Snips you could set up a conversation like this.

The limitation isn’t on the openHAB side so we can’t really fix it. The limitation is on the GA side. Alexa may be more flexible too, I don’t know.

1 Like

I was just thinking about it myself you would need constantly listening microphones and speakers and an immense amount of code/scripted responses and inputs

this is the next stage of a real smarthome/ digital AI something more like jarvis from iron man a real digital precence

I would replace every google home in my house right now and start writing the inputs and responses if it was in my skill level

Once you got the AI up and running I suppose sending the commands too openhab would be simple compared too that

I´m pretty sure this will come very soon. (within the next 1-5 years).

The issue is, atm the devices isnt suitable for asking questions. They are meant to answering questions and doing tasks. But I see no reason why they shouldn´t be able to ask questions as well. Only problem is - What questions would you like…
You´ll either have to predefine all kinds of questions which suits you. Or the device will have to learn all about you as an individual. (the last option is the one which can/will become a huge problem for most people, since this is what people dont seem to want due to ethical and private matters).

At the moment I dont see why the use of routines shouldnt be able to handle the pre-defined questions very easy. I´m pretty sure Google have already thought about this long time ago. They just need to “open” this feature. They already do have the “continue conversation” working.

1 Like

Hi @Kim_Andersen thanks for the reply

Like Rich said its already possible it’s just how do you go around doing it I personally would prefer it all too be ran locally and step away from Google or amazon it would just take an immense amount of time writing the responses ect as you say I would prefer too predefine the responses and inputs

@rlkoshak Thanks for the reply as always

I will do some more research on the projects you mentioned a few look like they may work but not for me for a long time alot of reading ect but i’m going too look into it some more :slight_smile: