07-24-2023 08:43 AM
This is a new problem. Several weeks ago, I used the example script to synchronize 2 lights found here: https://developers.home.google.com/automations/example-scripts#synchronize_two_lights
I replaced the sample lights with "basement main" and "basement main2" with are both Cync smart light switches wired to be 3-way switches. They're grouped together in the Cync app, but Google doesn't support device grouping like this unless you put them in their own "room." Google Home, in the past, has NOT functioned as if these are 3-way switches - thus this synchronizing attempt. Prior to this script, I'd have to turn off both switches via Google Home to turn off the lights these switches are wired to. If I use the Cync app, I only have to turn off 1 (expected behavior).
In an attempt to achieve the same functionality, I used the example script I linked to. And as I mentioned, there were no issues for a few weeks. Then a few days ago, my wife turned on the basement lights while I was at work (I wasn't home) to tell me the lights were flickering. At first, I thought it was perhaps an electrical problem. Then I turned the lights on yesterday and they flickered for me to. The behavior was not so much flickering in a strobing manner, but more like turning on and off at the switch. I attempted to troubleshoot the physical switches.
Then I checked my Google Home activity log and the lights were actually in an endless loop of running the Synchronizing automation. It was as if each time a light switch turned on, the other turned off and it kept going in a cycle. The odd part is a completely different switch in the same physical room, but assigned to another was also turning on and off. I double checked and it's not in the script.
Here's the sample code:
# ------------------------------------------------------------------------------------------ #
# Any line that starters with "#" sign is a comment and gets ignored.
# Indentation (i.e. Number of spaces before each line) is used to decide information hierarchy.
# To populate the template, please follow instructions listed via comments in this template.
# To learn more, please visit g.co/home/scripts for full documentation.
# ------------------------------------------------------------------------------------------ #
# ------------------------------------------------------------------------------------------ #
# Any line that starters with "#" sign is a comment and gets ignored.
# Indentation (i.e. Number of spaces before each line) is used to decide information hierarchy.
# To populate the template, please follow instructions listed via comments in this template.
# To learn more, please visit g.co/home/scripts for full documentation.
# ------------------------------------------------------------------------------------------ #
metadata:
name: Synchronize Basement Main switches
description: Synchronize two lights to turn on and off together
automations:
- starters:
- type: device.state.OnOff
device: Basement Main Room - Basement
state: on
is: true
condition:
type: device.state.OnOff
device: Basement Main Room 2 - Basement
state: on
is: false
actions:
- type: device.command.OnOff
devices: Basement Main Room 2 - Basement
on: true
- starters:
- type: device.state.OnOff
device: Basement Main Room - Basement
state: on
is: false
condition:
type: device.state.OnOff
device: Basement Main Room 2 - Basement
state: on
is: true
actions:
- type: device.command.OnOff
devices: Basement Main Room 2 - Basement
on: false
- starters:
- type: device.state.OnOff
device: Basement Main Room 2 - Basement
state: on
is: true
condition:
type: device.state.OnOff
device: Basement Main Room - Basement
state: on
is: false
actions:
- type: device.command.OnOff
devices: Basement Main Room - Basement
on: true
- starters:
- type: device.state.OnOff
device: Basement Main Room 2 - Basement
state: on
is: false
condition:
type: device.state.OnOff
device: Basement Main Room - Basement
state: on
is: true
actions:
- type: device.command.OnOff
devices: Basement Main Room - Basement
on: false
07-25-2023 07:19 AM
I think this might be a bigger issue. I noticed my Backyard lights behaving similarly, but not logged in the Google Activity log. They also use the same example script. Also, my smart plug is constantly turning on and off when this occurs, which is not linked to either of these automations - similar to how a light/switch is behaving similarly but not included in the automation as I described above.
08-16-2023 08:16 AM
I'm glad seeing that you also have this issue 😉 That means it isn't my mistake.
I just created this synchronization and sometimes it works in, but only in one direction 😞 At the moment this feature can't be used. Any other solutions?