[SOLVED] Integrating openhab and google assistant


(minnu maria) #3

That’s what i tried first.
Initially I opened home control on my google assistant app and in add devices searched for openhab and i clicked on it , the app displays your accounts have been linked successfully but then it does not display the openhab as a device it just displays you haven’t added any device.

I have attched the screenshot from the tutorial as well as the scrennshots of when I did the same thing that as in the tutorial.


(Angelos) #4

have you added tags to your items?
did you setup your myopenhab.org account and exposed items to it?


(minnu maria) #5

How and where exactly do i tag items?

I have created a basic ui with switchable light but that’s not how I do it?
i have attched a screenshot of my dashboard I haven’t aded any items.


(Angelos) #6

Are you using PaperUI or *.items files to define/create your items?


(minnu maria) #7

Basic UI
I have attached the screenshot of how my basic UI looks and also the code in items.


(Angelos) #8

BasicUI is used to parse and display *.sitemap files (not *.items). Of course, within your sitemap, you refer to items.

Try Switchable (instead of switchable)… maybe? this is the problem.

You can copy paste the code here with Code Fences (to avoid using screenshots)

Switch Light "light" <slider> [ "Switchable" ]

(minnu maria) #9

Alright.

So should I write this in sitemaps or items??


(Angelos) #10

within your ~/Desktop/OpenHAB/conf/items/a.items file


(minnu maria) #11

Thank you. Works fine now
When I say turn on light it is reflected in openhab as well.

Just one last doubt how can I integrate my oppenhab with another device(like arduino) which would be connected to my light. Should I use mqtt broker to interface openhab with a micro-controller device??


(Angelos) #12

Yes!

MQTT rulez


(Angelos) #14

This is out of scope for the openHAB Community :slight_smile:
I would try the https://forums.mbed.com/ (or google some samples)


(Kris K) #15

Is anyone working on Google Assistance with local instances of OpenHab Cloud?

I want to move to a Voice automated setup but use my on premise Openhabcloud. Im not fond on relying on things external to my home.

Or, does Alexa work with OpenHab Cloud local instance? Thank you


(Angelos) #16

I believe that very few people have it implemented like this. Most use myopenhab.org and the existing integration to Google Assistant.

Even if you manage to deploy like this, you will still depend on Google Cloud Functions
I believe that the same is true for Alexa (uses external cloud services)


(Waqas Ahmed) #18

Hello Dim,

  • I have added items via paper ui (added by auto discovery)

  • My Items are exposed and myopenhab.org is online and fully working

But when i add, it gets paired successfully but device does not show up in my devices (Similar to mmj6 Jun 11 post) section of google assistant.

I am using android 8 on Samsung Galaxy C7 (C7000)


(Angelos) #19

You need 2 stuff on top of exposing your Items to myopenhab.org: Labels & Tags for your Items

To add Labels = it’s easy you can use PaperUI (edit the Items)
To add Tags = unfortunately, PaperUI doesn’t support this yet. You will need to use either REST API and/or the console

By the way, troubleshooting is better under a new thread, not within an older thread :slight_smile:


(Waqas Ahmed) #20

I am not new to IOT Field, but I am new to openhab. Where to add labels, I can see the following screen on edit.

. More over can you suggest some guide for adding tags via REST API / Console?


(Angelos) #21

To edit your Items within PaperUI you need to:
PaperUI->Configuration->System->Item Linking->Turn off “Simple Mode”
You will be then presented with a new menu on the left side (just below the one that you have selected now (Things).

You can then edit the Items and add Labels

For Tags & REST API, see here a short guide: Official Alexa Smart Home Skill for openHAB 2

Check out also: HowTo: Listen & Talk to your Home

If you are an advanced user, you may want to consider using flat text config files for your *.items


(Waqas Ahmed) #22

Thank you Dim for your prompt replies. I’ll try your suggestions, I am an advanced user and write blog (definitely, I’ll write a complete post on it after figuring it out). I have a quick question. When items are added via Paper UI, there is no clues under etc\openhab2\items. Where do they get stored? is there any database? if so, where can i find it?


(Angelos) #23

Here you go:

Welcome to the openHAB world :slight_smile:

edit: I like your Log2Ram tip: https://hobbytronics.pk/raspbian-stretch-headless-setup/#MicroSD-Card-Life-Saving-Trick


(Waqas Ahmed) #24

Hello Dim, I have added the label and tag and tried once again to pair it with google assistant. It gets synced and an alert of “assigning room” pops out and still nothing gets added under devices in home control. Here is the json of the switch.
{
“link”: “http://192.168.50.30:8080/rest/items/wemo_socket_Socket_1_0_201612K003B1F9E_state”,
“state”: “NULL”,
“type”: “Switch”,
“name”: “wemo_socket_Socket_1_0_201612K003B1F9E_state”,
“label”: “Switch”,
“category”: “Switch”,
“tags”: [
“socket”
],
“groupNames”: []
}