Official Google Assistant Integration for openHAB

That is how i try it as well.
But now if i want to sync my google devices it tells me that my OH devices cant be synced and i should try to relink my account. I’ll definitly wont do that :wink:

@andirs

Try copying the style from here (HomeKit Addon):

You need Group which has the Thermostat Tag, then:

  • Current Temp (as a Number)
  • Mode (either number, if Zwave, or string but must have auto, on, off, etc.)
  • Setpoint (as a Number)

All assigned to the group. I think the mode is important, I tried to default in the event of failure to obtain, but does not appear to work.

Thanks for your answer. Problem is that my thermostats do not really feature a “Mode”. I have Homematic thermostats. The only items i have is a switch item to go to “Auto” and a Number item to set a “Manual” temperature disabling the automatic schedule.

I’ll think about a fake string item which then controls these other item within a rule… or does someone have a better idea?

Edit: I found a string “Control_Mode” but it is read-only and does not follow the naming on, off, auto …

I had the same problem, added the “CurrentTemperature” tag to 3 items and sync worked. Then I added another 3 tags and since then, I could not sync again.
Then I tried “Hey google: sync openHAB” and this worked.
Therefore, I think linking works to openHAB but fails to Philips HUE.

2 small comments:

  • Google Home seems to round temperature values to 0.5 degrees
  • When a current temperature item is NULL, I get the message: “Thermostat set to heating” or similar.

Many thanks to MARZIMA

@andirs

I had a similar problem, my house is old and could not get a tstat wire up to my 2nd floor. So I jury-rigged a wireless connection using pi-zeros with temp sensors (mqtt->OH2) and a zwave contact sensor for the furnace/valve (it’s hydronic).

I was trying to keep the spirit of how Google expects thermostat data from third-party systems (so the action complies). This is often hard though when there are situations like mine and yours where the manufacturer (or lack thereof for me) declines to have those variables.

What I have found though and what @BlueOH stumbled on as well is that the important thing is that there just needs to be something assigned to these values (or you get funny responses). For instance, for my makeshift thermostat I have Openhab restore the value to “heat” (since it’s a heat-only system) upon boot up.

I wonder if it makes sense, during SYNC to assign “auto” to the mode??

@MARZIMA
1st of all: Thanks much for your hard work!
The progress is really great and everything works like a charm so far.

But as you integrated “CurrentTemperature” and “Thermostat” now, i would ask you to add the corresponding examples to your first thread, as I’m for sure not the only one looking for “what google allows me to do with the devices”.

PS: a bit advertisement for my little project corresponding to the google integration: TagControl

Agree. I could need a list of available tags, both those which are suppose to work, and those which needs testing. And a small example as well.
This list should be updated when new tags is supported.

Reading the last few entries in this thread surely confuses me. I have seen “Termostat”, TargetTemperature" and “CurrentTemperature”.
As for my own tets, it seems like Google understand “CurrentTemperature”, but not “TargetTemperature”.

Im getting this too!

==> /var/log/openhab2/openhab.log <==
2018-05-08 08:07:17.349 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key _tags:Weather_Rain in ManagedMetadataProviderImpl, because it does not exists.

==> /var/log/openhab2/events.log <==
2018-05-08 08:07:17.364 [ome.event.ItemUpdatedEvent] - Item 'Weather_Rain' has been updated.
2018-05-08 08:07:17.368 [vent.ItemStateChangedEvent] - unifi_client_84655265_uptime changed from 42125 to 42136

==> /var/log/openhab2/openhab.log <==
2018-05-08 08:07:17.369 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key _tags:Weather_Wind_Speed in ManagedMetadataProviderImpl, because it does not exists.

I cant see how this is related to the Google Home stuff, as that is all in the cloud and this error is occuring locally.

All i did to cause this was to add CurrentTemperature tag to an item. I think there is now something broken in the items registry…
Do you have the Imperihome binding installed too? I ask because it also breaks my Imperihome.

2018-05-08 08:19:50.799 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /imperihome/iss/rooms
java.lang.NullPointerException: null
        at java.util.HashSet.<init>(HashSet.java:119) [?:?]
        at org.openhab.io.imperihome.internal.processor.DeviceRegistry.getRooms(DeviceRegistry.java:49) [229:org.openhab.io.imperihome:2.3.0.201804092039]
        at org.openhab.io.imperihome.internal.handler.RoomListHandler.handle(RoomListHandler.java:31) [229:org.openhab.io.imperihome:2.3.0.201804092039]
        at org.openhab.io.imperihome.internal.ImperiHomeApiServlet.service(ImperiHomeApiServlet.java:202) [229:org.openhab.io.imperihome:2.3.0.201804092039]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [31:javax.servlet-api:3.1.0]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [82:org.eclipse.jetty.security:9.3.21.v20170918]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [84:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [77:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [77:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [77:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [88:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [88:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [88:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [88:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [88:org.eclipse.jetty.util:9.3.21.v20170918]
        at java.lang.Thread.run(Thread.java:748) [?:?]


I can confirm that the tag CurrentTemperature is sufficient to get the temperature through Google Home.
Unfortunately I can confirm that the temperatures are rounded by Google to 0,5 °C.
Sometimes I get a response about the thermostat mode in the room rather than the temperature in the room.

no i don’t have the imperihome binding

Hi

There must be another location that the JSON data is stored and being referenced because…

I just deleted the entire contents of the jsondb folder and restarted OpenHab2.
Within seconds all the files were back in the jsondb folder, exactly as they were before I deleted them.
Still without the extra wall light dimmer, which is working perfectly in HabPanel.

Okay, not sure what happened here…

I’ve repeated the process and now I have new JSON files…
Which means I’ve effectively purged my system.

I’m going to try and drop the text for the new dimmer (from the new JSON file) into the backed up JSON file and restart with the edited old file/s in place.

That is because OH has an automated backup and restore feature. If the files don’t exist, it recovers the most most recent backup.

Are you certain there is an Item linked to a Channel on this Thing? If not there won’t be an entry in the Item DB file.

You moved past your collection of backups and now have a fresh DB with nothing in it.

I`m facing the same problem, all my itens that did work before, but that also use ImperiHome, are now gone. Did you found a workaround for it?

Thanks

@MARZIMA

I have this in my items configuration.

When i ask google “what is the temperature in the bedroom?” the response is “heating is set to 20, with a current temperature of 24”

When i say “set temperature to 19 degrees in the bedroom” the answer is “sure, setting the bedroom thermostat to 19 degrees”

When i say “set the heating to 21” the response is “sorry, i couldn’t reach openHAB”
What tag is google trying to change here?

Did you try “Set the heating to 21 in the bedroom”?

1 Like

Yes of course.
I think google is trying to set a mode on a tag that not exist. I dont have a mode on my thermostat.
I wil try to add a item for the mode function.

Google is QUITE specific about temperature, you need at least items for:

  • Mode
  • Setpoint / Target Temperature
  • Current Temperature / Ambient Temperature

(See the HomeKit addon page for further info on item setup, grouping, and tag usage).

I made my own “thermostat” with a temperature sensor and a dry contact so I had to have a Mode item for Google to properly provide temperature details.

There are also variables for high and low range, but there does not exist the HomeKit tag convention yet to support.

for now i use this:

Group gDownstairsThermostat "Downstairs Thermostat" (gFF) [ "Thermostat" ]
Number DownstairsThermostatCurrentTemp "Downstairs Thermostat Current Temperature" (gDownstairsThermostat) [ "CurrentTemperature" ]
Number DownstairsThermostatTargetTemperature "Downstairs Thermostat Target Temperature" (gDownstairsThermostat) [ "TargetTemperature" ]
String DownstairsThermostatHeatingCoolingMode "Downstairs Thermostat Heating/Cooling Mode" (gDownstairsThermostat) [ "homekit:HeatingCoolingMode" ]

but stil the same problem.
i can’t set the mode with google assistant

When i say “set the heating to 21” the response is “sorry, i couldn’t reach openHAB”

From Google I/O 2018 - a new Video " Integrate your smarthome with the Google Assistant"

Openhab gets referenced at about 30:44 :+1: @MARZIMA - Nice one!

This video is worth watching to see whats coming. New traits/device types…and notifications!

7 Likes

Did anyone solve the color bulbs problem? Do we need to add them as two devices to Google Home so we can switch them on/off and change color?