Official Google Assistant Integration for openHAB

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?

Hi @MARZIMA, is this planned for a next release?
It would be really useful, since not everything is controlled ‘only’ bij Google Home Assistant.
As a fact, to me this is only a secondary option. A nice-to-have. But primaraly my lights are controlled via hardware.

3 Likes

Dear Google Assistant experts,

I need a short hint how do decide between items I want to expose to Google Home and those I only need on my OH server.

Could you please quickly check All items with tag are exposed to Google Assistant and Amazon Echo? and give an advice? Thank you!

Edit: Resolved in that discussion - thanks!

Lock/unlock actions

Is there any plan to implement lock/unlock actions to the skill?

I want to say “Ok Google Unlock Frontdoor”

/mike

The same goes for open/close.

That would require Google to integrate that into their API, which currently is not the case.
Until then, you can use something like “Turn on front door lock”. With a proxy device called “front door lock” and the appropriate rules to forward the right commands to the door lock item.

How can Nuki have Okay Google, lock the door?
https://nuki.io/en/blog/new-nuki-smart-home-action-for-your-google-assistant/

/Mike

Is there any way that i can use my google home as a bridge to control device with my openhab?

For example, i have a device that is not supported by openhab but can be controlled by google home and i want to control it via a button in habpanel or add it in a rule. Is that possible?

thanks for you work by the way

Patrick

Yes. I will be publishing a how-to on that.

Hello, tried setting up a thermostat in home assistant. I can see the theremostat and open it in google home app, but it doesnt show the current temperature and i cant set the targettemperature or the mode. neigther can i see the current humidity.

Group  GF_Hallway_Thermostat            "Thermostaat gang"                                                                     [ "Thermostat" ]
Number GF_Hallway_HeatingMode           "Verwarmingsmode gang [%s]" (GF_Hallway_Thermostat)         [ "homekit:HeatingCoolingMode" ] 
Number GF_Hallway_Temp_Meas_BedroomDoor "Gemeten temperatuur gang [%.1f °C]"  <temperature>        (GF_Hallway_Temp_Meas, gTemp_Meas, ID125, GF_Hallway_Thermostat)      [ "CurrentTemperature" ]      
Number GF_Hallway_Temp_Target           "Gewenste temperatuur gang [%.1f °C]" <temperature>       (GF_Hallway, gTemp_Target, gHallway_Temp_Chart, GF_Hallway_Thermostat)      ["TargetTemperature"]
Number GF_Hallway_Hum_BedroomDoor       "Luchtvochtigheid gang [%.1f %%]"     <humidity>          (GF_Hallway_Hum, ID125, GF_Hallway_Thermostat)      [ "CurrentHumidity" ]

Does anyone see something wrong with my items? I really cant semm to find a problem.

Lighting tags work great for me.