Official Google Assistant Integration for openHAB

Hi Aart, any update on this? Did @Marzima give you permission to make the Google Assistant integration experience an even better one?

Hi All,

I have a Daikin wifi adapter for my HVAC system which I have working nicely with a modified version of the OpenDaikin binding (the .au Daikin adapter is (of course) slightly different to the .eu version!).

I’m now trying to get it setup to work with the Google Asssistant, however, whilst I can show the indoor temperature fine, I can’t change the target temperature.

I have the following item configuration (from smarthome:items list)

gThermostat (Type=GroupItem, Members=3, State=NULL, Label=Thermostat, Category=null)
DaikinACUnit19216817_SetPoint (Type=NumberItem, State=25.0 °, Label=Set Point, Category=Temperature, Tags=[TargetTemperature], Groups=[gThermostat])
DaikinACUnit19216817_IndoorTemperature (Type=NumberItem, State=31.0, Label=Indoor Temperature, Category=Temperature, Tags=[CurrentTemperature], Groups=[gThermostat])
DaikinACUnit19216817_Mode (Type=StringItem, State=NULL, Label=Mode, Category=null, Tags=[homekit:HeatingCooling], Groups=[gThermostat])

Any suggestions? I’m sure I’m missing something obvious!

I have a bunch of other lights and switches working perfectly.

Cheers,

Paul

OK I realised the group didn’t have the ‘Thermostat’ tag, I’ve now added it:

gThermostat (Type=GroupItem, Members=3, State=NULL, Label=Thermostat, Category=null, Tags=[Thermostat])

and refreshed GA, and now it seems to work, except for now, I can’t change modes, as the Daikin modes don’t align with GA.

I have connected Google with the thermostat server direct. This way Google and Openhab see the same information and able to change. Google sees the zones individually and able to give back or adjust the temperature. I have Honeywell Evohome system. What is more interesting that it works with Geo-fencing. Also my smartlock works with Geo-fencing. It is 3 applications what ruins my phone battery. So I’m working on to move Geo-fencing to Openhab and this way I can prolong battery life of my phone, plus more safe as only one application uses my location data. Also easier if you want to make more complex rules for a family. Family Geo-fencing works currently with Life360 and IFTT + Honeywell server. Too complex and it is not battery saver at all.

I have a question about the ‘Dimmer’ item.
I’ve managed to set-up a dimmer item, and control it with google assistant.
The dimmer is working fine, when I say ‘OK Google, set kitchenlight to 50 percent’.
But when I give the command ‘OK Google, turn off the kitchenlight’, It recognizes the command, and promts that It will execute, but nothing happens.
How can I solve this issue? Do I need a second item that is not of dimmer but of switch type?

1 Like

For Dimmers, use category DimmableLight to have Off/On switch in addition to the Percent.
M

Can you posr your item configuration?


Dimmer LEDKitchen "Kitchenlight" ["Lighting"] {channel="mqtt:topic:MQTTVerlichting:LEDKitchen"}

Have you checked your logs?
I guess you are using the new 2.4 mqtt binding?
I didn’t have test Google Assistant on the new mqtt binding but I think the binding cannot handle an “OFF” command.

That might be the issue, because it only accepts a percentage value between 0 and 100.
Is there a possibility to make the assistant integration binding not send ‘OFF’ but just ‘0’ and ‘100’ (or a predef. value) for ‘ON’?

U can use a dummy item and a rule, but in my opinion, the 2.4 mqtt binding must handle the ON and OFF commands as described here.
@David_Graeff can you verify this issue?

A percentage channel of the mqtt binding can also handle ON/OFF or custom on/off payloads.

Hi @David_Graeff
How can I set this in the Channel of the Thing?
I have configured a minium and a maximum value, do these represent the ON and OFF states?

edit: here is the log output when sending the OFF command from Google:


23:45:13.488 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Verlichting_LEDKeukenKast' received command OFF

followed by:

23:42:32.352 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.eclipse.smarthome.binding.mqtt.generic.internal.handler.GenericThingHandler@1c40256': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:494) ~[?:?]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:?]
        at java.math.BigDecimal.<init>(BigDecimal.java:806) ~[?:?]
        at org.eclipse.smarthome.core.library.types.DecimalType.<init>(DecimalType.java:57) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]
        at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:47) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]
        at org.eclipse.smarthome.core.library.types.PercentType.valueOf(PercentType.java:63) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]
        at org.eclipse.smarthome.binding.mqtt.generic.internal.values.PercentageValue.update(PercentageValue.java:87) ~[?:?]
        at org.eclipse.smarthome.binding.mqtt.generic.internal.generic.ChannelState.publishValue(ChannelState.java:302) ~[?:?]
        at org.eclipse.smarthome.binding.mqtt.generic.internal.handler.AbstractMQTTThingHandler.handleCommand(AbstractMQTTThingHandler.java:119) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
        at com.sun.proxy.$Proxy148.handleCommand(Unknown Source) [227:org.eclipse.smarthome.binding.mqtt.generic:0.10.0.oh240]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
        at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

I’ve looked at the documentation once more, but I can’t find that the percentage channel accepts ON OFF commands… the Color does. I’ve tested it with this channel and it works. The only thing is that the payload is malformed for my device: I need 0-100 or 0-255, not 255,255,255 (for on)…

Hi,
after to upgrade to 2.4 and after to remove connection Openhab from my GoogleHome (just to a test), now I cannot to re-connect Openhab because I receive an error of connection on my Android phone.
I restarted openhab, I cleaned the cache, but nothing change.
How I can to do debug?

thx

I have a little annoying problem. I add a switchable item and sync it with Google Assistant (Jour). I can switch ON and OFF and it works without errors. But If I made a “routine” inside “Home” Apps (modifiy Bonjour routine), when I call the routine ("Ok Google, Bonjour), switch item change to the desired value but my google home say “je ne peux pas trouver THE Jour” In english it probably say “I can find the jour”. I assigne a room to this switch but I have always this error.
Same problem here : Google Home routines error
Ok found the issue here : https://github.com/openhab/openhab-google-assistant/issues/44

Hi @MARZIMA

Is the binding a one way communication for items?
I have a dimmer item configured, that sends commands, but also receives statusses.
This because the dimmer item is also controllable via a simple pushbutton.
OpenHAB recognises this change, and updates the item, but on Google Home, the light remains unchanged.
So when I say ‘OK Google, turn light on’ it does, but when I turn it back off again with the pushbutton, Google still thinks its turned on.

Just looked up the code and percentage indeed only supports min and max and no custom on/off.
If you create a feature request on the eclipse smarthome git repository, I will tackle that.

Another problem I have is that Google Home Assistant often provides me with the response that it’s unable to sync devices from OpenHAB.
On the other hand, when I issue a voice command of an existing item, it works. It’s just unable to recognise new ones (even though they are listed in myopenhab, so the eposure is OK)

1 Like

It is the direction GA to openHAB. We dont report state back, so this might cause your situation. There is now a reportState functionality at Google, but on OH side we dont use it. Google wont know about any state change currently if the state of your item will be changed in any other way.

BR Mehmet

Why not??

Also, do you know if/when we can use Group type items?