Official Google Assistant Integration for openHAB

I just want to give a huge thanks to @MARZIMA.
The Action works in Japanese too.

1 Like

Hi,

first of all, Thanks a lot for the hard work you’ve put into this - you can’t imagine how glad I am that this is available now.
However…while I see all of my elements from myopenhab correctly listed and synched / resynched, I don’t seem to be able to control anything:
“switch on ‘xyz’” only leads to “you need to name the device you want to switch on”.
[german: "Schalte ‘xyz’ ein leads to “Du musst das Gerät nennen, das geschaltet werden soll”]

Did I miss anything? Alexa works by the same Tags via myopenhab…

Thanks!

I’ve tried it both ways and neither have worked. I’m giving up and will revisit once the binding has matured a bit.

If you want help, post the contents of the items file inside code fences.
If it is complaining about their being no name my guess is you have no name in quotes in your items file. The name is in quotes with no brackets around it. The tag must be at the end unless you specify a channel in curly braces, in which case the tag [ “Lighting” ] must be directly before the channel declaration in curly braces.

two examples:

Switch KitchenLights "Kitchen Lights"  [ "Lighting" ]
Dimmer BedroomLights "Bedroom Lights" [ "Lighting" ]

I have found a number of times that google will not sync my devices when asked, it takes a long time like it is about to work and then it fails with one of the generic replies. When this happens you remove openhab and re-add and link it again in the google home app and then instantly it will work.

How to define Szenes with Google Home? Like adjusting different lights & turn on music?

Scenes can be done by creating a switch item with the name of the scene, then you add the tag switchable.

example

Switch myNewScene "My Wifi"  [ "Switchable" ]

Hey google turn My Wifi on

And to this google will probably reply “I’m sorry I don’t know how to turn my wife on, but I’m always learning”
:wink:

1 Like

Hi,
I was using REST API and found that working quite well for Alexa. Google also lists the elements correctly…but does not control them

 {
    "link": "https://home.myopenhab.org:443/rest/items/Bad_1_Level",
    "state": "0",
    "stateDescription": {
      "minimum": 0,
      "maximum": 1,
      "step": 0.1,
      "pattern": "%.2f %%",
      "readOnly": false,
      "options": []
    },
    "type": "Rollershutter",
    "name": "Bad_1_Level",
    "label": "Bad Rollo",
    "category": "Blinds",
    "tags": [
      "Lighting"
    ],
    "groupNames": []
  },

any suggestions?

THX

Hello Dominic,

I’ve played a little bit with Milight and google assistant and I’m able to control light ON/OFF, Dimming and Color.
First of all, I set up 2 items ( Dimming and Color ) for the same light in the same Google room, but I’m not sure this is mandatory ( I must test with only color item)

If I don’t misunderstand you’re a french guy no ? If this is the case, this may help you :
In french, if I say “Allume la lumière du salon” or “Eteint la lumière du salon” to switch them ON/OFF, it works.
But if I want to set a Dim or a color I must say something like “Règle les lumières du salon en bleu” or “Règle les lumières du salon sur 20%” or even “Lumière du salon a 30%” but if I say “Allume les lumières du salon a 30%” it will not work.

But we have some bug, Color are not matching (say Red to google, it will be orange, say Orange it will be Yellow, but blue and green works) and more annoying, you can’t set it up to back to white mode, even if you say “Règle les lumières sur blanc” because of how the Milight works. So, I wrote a rule to send whitemode command each time I use a Dim command (because I only use DIM when I’m in White mode, not in color mode) but I’m only able to do that because I’ve build a custom Milight Hub that respond to WebAPI command in addition of standard Milight protocol. With this I can set up a color, and when I want to go back to White Mode, I use a Dim order.

Hope it help !

BR.

1 Like

BTW, this feature should work without owning any Google Home devices.

You should be able to install the Google home app on an Android or iOS device, and set up your OpenHAB devices, and then use assistant on your phone (Android, iOS), or Android Auto.

1 Like

yeah i was checking status of items on my way home via my head unit (AA) the other day. fun stuff!

Also, note that you can set up Shortcuts in the Google Assistant App and call those from your Google Home. For example, if one were to tag a garage door opener with “Switchable” you can create a shortcut where if you say “open the garage” or “close the garage” it will translate that to “turn ON the garage”. You can create shortcuts that issue multiple commands. For example “Hey google, time to read” which gets translated to “turn on the bedroom light, turn off the family room lamp, …”

1 Like

@MacFly
I wrote my own binding for milight and I added a feature that allows you to not only reach white mode with google assistant but it also allows you to specify which white you prefer as a binding parameter.

I have a user that tested it successfully with a widget that needed it for the same reason as I made the feature configurable and able to be turned off

More info at this thread

1 Like

Hello all,

Just for the record, if someone has “syncing unavailable for assistant” error:

In my case the problem was a newbie error:
On sitemap (and transform) I had:
Switch item=TV_LIVINGROOM label=“tvPower” icon=“tv” mappings=[tvON=“On”, tvOFF=“Off”]

changing to
Switch item=TV_LIVINGROOM label=“tvPower” icon=“tv” mappings=[ON=“On”, OFF=“Off”]

solved everything :slight_smile:

Maybe the issue was the state of the switch, and not the sitemap itself.

Does GA understands On and Off only, or what are the other options (like select channel etc…)

Quite strange, I have lot of milight (and different generation CW and CCW) and it works fine with colors and white ! For CCW, when I ask to switch to white I can’t control temperature color and it always switch to warm white.

GA sends ON or OFF which is why your mapping failed to work, On is not the same as ON.
Delete the mapping altogether and it will still work and be cleaner to read.

GA can send either a percenttype ( 0 to 100 value) useful for slider items, a HSBtype (100,100,100) useful for colorpicker items, or ON and OFF for switch items. It should be noted that if using a color item google does not only send a HSB, it can be a percenttype or ON and OFF. When writing a binding you need to ensure all the types can be handled correctly.

Can we add these Google tags in PaperUI? All my items are created via PaperUI and I need them to be exposed to Google Home. Thanks

Then google will respond “turning your garage door off”

Ive been using “Open Sesame” and “Close Sesame” for my garage door…
Friends and kids think its magic! ( So I don’t have to say OK Google, I long press the home button on my phone so Assistant is listening )

4 Likes

@MARZIMA Hi, i could not send a PM for some reason. I am in touch with Allion to get a 3rd party App certified. It is not for openHAB though, but they told me to get in touch with you since you just did the same process a few weeks back :slight_smile: Can you tell me what you have shipped over to them? Thanks, Dennis

Hi what’s the best way to work with Raffstores with Google Home.

I would mostly need Close and Shade. On Open for cleaning only.