HA Cloud + Google Home: Sonoff detected but not working

I am relative new to Hass.io, but I have managed to set up my Philips Hue and Ikea Trådfri lights, some Z-wave sensors and my Sonoff (with Tasmota). I have just recently added Home Assistant Cloud and Google Home support for Hass.io.

Controlling lights is no problem using my Google Home, however I have a coffee machine connected to a Sonoff. Google Home is detecting the device when I sync devices, and I can confirm this by checking the Google Home app.

However, when I try to switch on or off the device through Google Home, I receive a confirmation “OK”, but the switch itself doesn’t change. In both Hass.io, through the TasmotaAdmin addon and directly on the Sonoff’s IP address it functions correctly. Am I missing something? I am not sure where to start to debug either.

I have though noticed that sometimes the switch disappears from Hass.io (even though the IP is working), and randomly shows up, but this has no effect on Google Home as I have tested it when everything works fine in Hass.io

Here is my very simple cloud configuration setup:

google_actions:
  filter:
    include_entities:
     - light.kjkken
     - light.spisestue
     - light.stue
    include_domains:
     - switch
    exclude_entities:
     - light.utelys
  entity_config:
    light.kjkken:
      name: Kitchen lights
      aliases:
       - kitchen lights
       - downstairs light
      room: kitchen
    switch.sonoff:
      name: Coffee machine
      aliases:
       - coffee maker
      room: kitchen

since you have include_entities: try add switch.sonoff inside that as well.

Are you sure you’re using the right MQTT topic.

@finity How do I check that? The switch works perfect in Hass.io

@Sunonline Unfortunately that didn’t do anything.

If you have another MQTT sniffer software (I use MQTTFx) you can subscribe to all topics (#) and see what is being sent and you can look at the tasmota sonoff control panel and see what the topic is supposed to be to see if they match.

Thanks. I did what you said, and I see that when I ask Google Home to turn on the coffee machine, nothing happens. However, when asking to turn off the coffee machine, it sends three MQTT messages:

topic: domoticz/in
message: {"idx":745,"nvalue":0,"svalue":"","Battery":89,"RSSI":4}

topic: stat/sonoff/RESULT
message: {"POWER":"OFF"}

topic: stat/sonoff/POWER
message: OFF

I was surprised by the Domoticz message, but that seems to be a setting in Tasmota that the Sonoff is flashed with.

When I try to turn on with Google Home, nothing happens (no MQTT messages), but when I turn on with Hass.io, this happens:

topic: domoticz/in
message: {"idx":745,"nvalue":1,"svalue":"","Battery":91,"RSSI":7}

topic: stat/sonoff/RESULT
message: {"POWER":"ON"}

topic: stat/sonoff/POWER
message: ON

So I find it strange that Google Home can turn this switch off, but never turn it on?

Did you do an “update devices” in google home?

Can you see your switch in the GHome app?

Yes, it’s listed under my devices as a switch.