Official Google Assistant Integration for openHAB

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.

Does this actually require the Google Home Hardware? I have downloaded the App and tried to follow the steps to connect to myopenhab. but The app looks totally different to me and I have no way to connect oh myopenhab. It seems that this feature is simply not available…

No it doesn’t, all you need is the Google Home app, and then you can use Google Assistant on your phone. Here’s documentation from Google: https://support.google.com/googlehome/answer/7073578?hl=en

Hi, I couldn’t find a description how to install the binding into openHAB.
Can anyone pinpoint me how get the Binding?

I didn’t have to install anything, other than openHAB Cloud Connector.

Need minds greater than mine.
I’d like to use the voice control to set the channel on my TV. (I have the LG binding installed)

I know I could make a virtual switch (eg channel 22) so that when I say turn on channel 22 it will then run it. That would mean a switch for all the channels I want. This would use the Switchable tag

Would it work if I make a virtual dimmer so when I say “Set the TV Channel to 22” it will ‘dim’ the virtual switch to 22% and then have a rule fire off to the TV channel 22? There would then be one rule for all the percentages for the channels??? (There are no channels past 100) This would use the Lighting tag.

Where would I even start?
Can rules send commands at a specific percentage?

Thanks Josh

1 Like

You would use a Dimmer Item. Tag it with “Lighting” and you should be able to do what you describe. Furthermore, you can also send ON/OFF commands and use those in your Rule to turn on/off the TV as well.

There might be some weirdness (e.g. it will turn to channel 100 when you turn it ON, it might turn OFF the TV when you issue “Turn off all the lights”) but I think it could work.