Issues with HomeAssistant's automation (or GoogleHome's automation) using Yeelight

Hi everyone,

I’m facing some issues with automating a Yeelight.light.color4 bulb and a Shelly1Plus switch using Google Home on Home Assistant 13.2.

Setup:

  • Yeelight bulb: Directly connected to the power supply, always online.
  • Shelly1Plus: Wired to control the physical switch…
  • Home Assistant: Version 13.2
  • Automation: I’ve created two automations and two scripts (attached) to sync the state between the bulb and the switch.

Problem: When I control the Yeelight bulb using Google Home or the Yeelight app, the automations don’t trigger, and the Shelly1Plus state remains unchanged. However, if I control the Shelly1Plus directly through Google Home or the Shelly app, everything works fine.

I’ve also tried creating automations directly in Google Home, but I’m still facing the same issue.

  • Any logs is present on Hassio when turn on the light by GoogleHome or YeelightAPP

Here are my automations and scripts:

alias: Sync Light with Shelly

description: Sincronizza lo stato della lampadina con lo stato dello Shelly

triggers:
Automazione 1
  - entity_id:

      - switch.shellyplus1_toggle_boa

    trigger: state

conditions: []

actions:

  - action: script.sync_light_with_shelly

    data: {}



2 automazione 

alias: Sync Shelly with Light

description: Sincronizza lo stato dello Shelly con lo stato della lampadina

triggers:

  - entity_id:

      - light.yeelight_boa

    trigger: state

    attribute: brightness

conditions: []

actions:

  - action: script.sync_shelly_with_light

    data: {}



1 script

alias: Sync Light with Shelly

sequence:

  - choose:

      - conditions:

          - condition: state

            entity_id: switch.shellyplus1_toggle_boa

            state: "on"

        sequence:

          - target:

              entity_id: light.yeelight_boa

            action: light.turn_on

            data: {}

      - conditions:

          - condition: state

            entity_id: switch.shellyplus1_toggle_boa

            state: "off"

        sequence:

          - target:

              entity_id: light.yeelight_boa

            action: light.turn_off

            data: {}



2script

alias: Sync Shelly with Light

sequence:

  - choose:

      - conditions:

          - condition: state

            entity_id: light.yeelight_boa

            state: "on"

        sequence:

          - target:

              entity_id: switch.shellyplus1_toggle_boa

            action: switch.turn_on

            data: {}

      - conditions:

          - condition: state

            entity_id: light.yeelight_boa

            state: "off"

        sequence:

          - target:

              entity_id: switch.shellyplus1_toggle_boa

            action: switch.turn_off

            data: {}

I’ve followed this guide for the initial setup: [Link to the guide] But I’ve created my own automations instead of using the ones from the guide.

Any help or suggestions would be greatly appreciated!

Hello Bruno,

I believe you either have to have the automation steps in HA and control it there
OR
Create a script that calls a scene (automation) that you have in Google,

(Not an expert though, I think this is how it works. I stick only with the HA tools)

Ok… So why if try trigger the automation (deploy on Hassio) with shelly in Google home every thing works correctly?

The problem is all about the light bulb. I have the impression that the problem is not turning it on or off, but rather its brightness. Since the light bulb is always plugged in, it never turns off completely, but its brightness can vary from 0% to 100%. However, I do not know how to verify whether this hypothesis of mine is correct and, if so, how to act accordingly. I am open to any suggestions or ideas to solve the problem.