Zigbee stair switch problem

Hello,

I own Bseed Zigbee no-neutral switches, which I used before I bought HA Yellow with a Chinese Zigbee gateway via the SmartLife app. In SmartLife, I have linked three switches together, and whenever one of them was toggled, the same action was performed on the others.

About four months ago, I purchased HA Yellow. I was able to add all of my devices (some using quirks and some already had a working ZHA implementation available). So far, everything works except the switches.

To be honest, I have already tried several automations to make them work like they used to, but nothing works 100 percent. Currently, I am testing only two switches in my bedroom. Basically, if I do not use them for some time, they usually work okay. But once I toggle them several times in a short period, the other switch is not toggled. Also, it is strange to me that when I do it via a group in the HA environment, it works fine. Does anyone have a similar experience? As already mentioned, I have tried several different automation approaches, but with no luck. I have also tried to slightly modify the quirk I am using to see if anything changes—still nothing.

Any help is appreciated

My current automation:

alias: Bedroom Light Switches sync
description: Bedroom Light Switches sync
mode: single
triggers:
  - entity_id:
      - switch.bedroom_door_light_switch
      - switch.tz3000_hafsqare_ts0011_switch
    from:
      - "on"
      - "off"
    to:
      - "on"
      - "off"
    trigger: state
conditions: []
actions:
  - target:
      entity_id:
        - switch.bedroom_door_light_switch
        - switch.tz3000_hafsqare_ts0011_switch
    action: homeassistant.turn_{{ trigger.to_state.state }}

Device diagnostic:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2025.1.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.13.1",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Prague",
    "os_name": "Linux",
    "os_version": "6.6.62-haos-raspi",
    "supervisor": "2024.12.3",
    "host_os": "Home Assistant OS 14.2",
    "docker_version": "27.2.0",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "bambu_lab": {
      "documentation": "https://github.com/greghesp/ha-bambulab",
      "version": "2.0.40",
      "requirements": [
        "cloudscraper"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/use/",
      "version": "2.0.5",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "hassio",
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "dmulcahey",
      "adminiuga",
      "puddly",
      "TheJulianJES"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp",
      "zha",
      "universal_silabs_flasher"
    ],
    "requirements": [
      "universal-silabs-flasher==0.0.25",
      "zha==0.0.45"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*slzb-07*",
        "known_devices": [
          "smlight slzb-07"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*conbee*",
        "known_devices": [
          "Conbee III"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_uzg-01._tcp.local.",
        "name": "uzg-01*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      },
      {
        "type": "_xzg._tcp.local.",
        "name": "xzg*"
      },
      {
        "type": "_czc._tcp.local.",
        "name": "czc*"
      },
      {
        "type": "_zigbee-coordinator._tcp.local.",
        "name": "*"
      }
    ],
    "is_built_in": true,
    "overwrites_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.0001339250011369586
    },
    "01J9DS2FRBNNP9YP1CTKFT16ZK": {
      "wait_import_platforms": -0.034226073999889195,
      "wait_base_component": -0.001228385001013521,
      "config_entry_setup": 12.420403983000142
    }
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 26804,
    "manufacturer": "_TZ3000_hafsqare",
    "model": "TS0011",
    "name": "_TZ3000_hafsqare TS0011",
    "quirk_applied": true,
    "quirk_class": "ts001x.TuyaSingleNoNeutralSwitch_2_marek",
    "quirk_id": null,
    "manufacturer_code": 4417,
    "power_source": "Battery or Unknown",
    "lqi": 232,
    "rssi": -42,
    "last_seen": "2025-02-01T18:12:12",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "node_descriptor": {
        "logical_type": 2,
        "complex_descriptor_available": 0,
        "user_descriptor_available": 0,
        "reserved": 0,
        "aps_flags": 0,
        "frequency_band": 8,
        "mac_capability_flags": 128,
        "manufacturer_code": 4417,
        "maximum_buffer_size": 66,
        "maximum_incoming_transfer_size": 66,
        "server_mask": 10752,
        "maximum_outgoing_transfer_size": 66,
        "descriptor_capability_field": 0
      },
      "endpoints": {
        "1": {
          "profile_id": "0x0104",
          "device_type": "0x0103",
          "input_clusters": [
            "0x0000",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006"
          ],
          "output_clusters": [
            "0x0019"
          ]
        }
      },
      "manufacturer": "_TZ3000_hafsqare",
      "model": "TS0011"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "switch.bedroom_door_light_switch",
        "name": "_TZ3000_hafsqare TS0011"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "ON_OFF_LIGHT_SWITCH"
      }
    ],
    "user_given_name": "Bedroom door light",
    "device_reg_id": "f4daf9763ca521600282067a4fae9f0a",
    "area_id": "bedroom",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "ON_OFF_LIGHT_SWITCH",
          "id": 259
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0013": {
                "attribute": "ZCLAttributeDef(id=0x0013, name='alarm_mask', type=<flag 'AlarmMask'>, zcl_type=<DataTypeId.map8: 24>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0001": {
                "attribute": "ZCLAttributeDef(id=0x0001, name='app_version', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": 80
              },
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0006": {
                "attribute": "ZCLAttributeDef(id=0x0006, name='date_code', type=<class 'zigpy.types.basic.LimitedCharString.<locals>.LimitedCharString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0012": {
                "attribute": "ZCLAttributeDef(id=0x0012, name='device_enabled', type=<enum 'Bool'>, zcl_type=<DataTypeId.bool_: 16>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0014": {
                "attribute": "ZCLAttributeDef(id=0x0014, name='disable_local_config', type=<flag 'DisableLocalConfig'>, zcl_type=<DataTypeId.map8: 24>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0008": {
                "attribute": "ZCLAttributeDef(id=0x0008, name='generic_device_class', type=<enum 'GenericDeviceClass'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0009": {
                "attribute": "ZCLAttributeDef(id=0x0009, name='generic_device_type', type=<enum 'GenericLightingDeviceType'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0003": {
                "attribute": "ZCLAttributeDef(id=0x0003, name='hw_version', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0010": {
                "attribute": "ZCLAttributeDef(id=0x0010, name='location_desc', type=<class 'zigpy.types.basic.LimitedCharString.<locals>.LimitedCharString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0004": {
                "attribute": "ZCLAttributeDef(id=0x0004, name='manufacturer', type=<class 'zigpy.types.basic.LimitedCharString.<locals>.LimitedCharString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": "_TZ3000_hafsqare"
              },
              "0x000c": {
                "attribute": "ZCLAttributeDef(id=0x000C, name='manufacturer_version_details', type=<class 'zigpy.types.basic.CharacterString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0005": {
                "attribute": "ZCLAttributeDef(id=0x0005, name='model', type=<class 'zigpy.types.basic.LimitedCharString.<locals>.LimitedCharString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": "TS0011"
              },
              "0x0011": {
                "attribute": "ZCLAttributeDef(id=0x0011, name='physical_env', type=<enum 'PhysicalEnvironment'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0007": {
                "attribute": "ZCLAttributeDef(id=0x0007, name='power_source', type=<enum 'PowerSource'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": 3
              },
              "0x000a": {
                "attribute": "ZCLAttributeDef(id=0x000A, name='product_code', type=<class 'zigpy.types.basic.LVBytes'>, zcl_type=<DataTypeId.octstr: 65>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x000e": {
                "attribute": "ZCLAttributeDef(id=0x000E, name='product_label', type=<class 'zigpy.types.basic.CharacterString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x000b": {
                "attribute": "ZCLAttributeDef(id=0x000B, name='product_url', type=<class 'zigpy.types.basic.CharacterString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": 0
              },
              "0x000d": {
                "attribute": "ZCLAttributeDef(id=0x000D, name='serial_number', type=<class 'zigpy.types.basic.CharacterString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0002": {
                "attribute": "ZCLAttributeDef(id=0x0002, name='stack_version', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x4000": {
                "attribute": "ZCLAttributeDef(id=0x4000, name='sw_build_id', type=<class 'zigpy.types.basic.CharacterString'>, zcl_type=<DataTypeId.string: 66>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='zcl_version', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": 3
              }
            },
            "unsupported_attributes": []
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='identify_time', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              }
            },
            "unsupported_attributes": []
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='name_support', type=<flag 'NameSupport'>, zcl_type=<DataTypeId.map8: 24>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              }
            },
            "unsupported_attributes": []
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='count', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0002": {
                "attribute": "ZCLAttributeDef(id=0x0002, name='current_group', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0001": {
                "attribute": "ZCLAttributeDef(id=0x0001, name='current_scene', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0005": {
                "attribute": "ZCLAttributeDef(id=0x0005, name='last_configured_by', type=<class 'zigpy.types.named.EUI64'>, zcl_type=<DataTypeId.EUI64: 240>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0004": {
                "attribute": "ZCLAttributeDef(id=0x0004, name='name_support', type=<flag 'NameSupport'>, zcl_type=<DataTypeId.map8: 24>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0003": {
                "attribute": "ZCLAttributeDef(id=0x0003, name='scene_valid', type=<enum 'Bool'>, zcl_type=<DataTypeId.bool_: 16>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              }
            },
            "unsupported_attributes": []
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x8001": {
                "attribute": "ZCLAttributeDef(id=0x8001, name='backlight_mode', type=<enum 'SwitchBackLight'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read|Write|Report: 11>, mandatory=False, is_manufacturer_specific=False)",
                "value": 1
              },
              "0x8000": {
                "attribute": "ZCLAttributeDef(id=0x8000, name='child_lock', type=<enum 'Bool'>, zcl_type=<DataTypeId.bool_: 16>, access=<ZCLAttributeAccess.Read|Write|Report: 11>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x4000": {
                "attribute": "ZCLAttributeDef(id=0x4000, name='global_scene_control', type=<enum 'Bool'>, zcl_type=<DataTypeId.bool_: 16>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x4002": {
                "attribute": "ZCLAttributeDef(id=0x4002, name='off_wait_time', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": 0
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='on_off', type=<enum 'Bool'>, zcl_type=<DataTypeId.bool_: 16>, access=<ZCLAttributeAccess.Read|Report|Scene: 25>, mandatory=True, is_manufacturer_specific=False)",
                "value": 1
              },
              "0x4001": {
                "attribute": "ZCLAttributeDef(id=0x4001, name='on_time', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": 0
              },
              "0x8002": {
                "attribute": "ZCLAttributeDef(id=0x8002, name='power_on_state', type=<enum 'PowerOnState'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read|Write|Report: 11>, mandatory=False, is_manufacturer_specific=False)",
                "value": 2
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x4003": {
                "attribute": "ZCLAttributeDef(id=0x4003, name='start_up_on_off', type=<enum 'StartUpOnOff'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x8004": {
                "attribute": "ZCLAttributeDef(id=0x8004, name='switch_mode', type=<enum 'SwitchMode'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read|Write|Report: 11>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              }
            },
            "unsupported_attributes": []
          }
        },
        "out_clusters": {
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {
              "0xfffd": {
                "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0002": {
                "attribute": "ZCLAttributeDef(id=0x0002, name='current_file_version', type=<class 'zigpy.types.basic.uint32_t'>, zcl_type=<DataTypeId.uint32: 35>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": 80
              },
              "0x0003": {
                "attribute": "ZCLAttributeDef(id=0x0003, name='current_zigbee_stack_version', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0004": {
                "attribute": "ZCLAttributeDef(id=0x0004, name='downloaded_file_version', type=<class 'zigpy.types.basic.uint32_t'>, zcl_type=<DataTypeId.uint32: 35>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0005": {
                "attribute": "ZCLAttributeDef(id=0x0005, name='downloaded_zigbee_stack_version', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0001": {
                "attribute": "ZCLAttributeDef(id=0x0001, name='file_offset', type=<class 'zigpy.types.basic.uint32_t'>, zcl_type=<DataTypeId.uint32: 35>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x000a": {
                "attribute": "ZCLAttributeDef(id=0x000A, name='image_stamp', type=<class 'zigpy.types.basic.uint32_t'>, zcl_type=<DataTypeId.uint32: 35>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0008": {
                "attribute": "ZCLAttributeDef(id=0x0008, name='image_type_id', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0006": {
                "attribute": "ZCLAttributeDef(id=0x0006, name='image_upgrade_status', type=<enum 'ImageUpgradeStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0007": {
                "attribute": "ZCLAttributeDef(id=0x0007, name='manufacturer_id', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0009": {
                "attribute": "ZCLAttributeDef(id=0x0009, name='minimum_block_req_delay', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0xfffe": {
                "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x000b": {
                "attribute": "ZCLAttributeDef(id=0x000B, name='upgrade_activation_policy', type=<enum 'UpgradeActivationPolicy'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              },
              "0x0000": {
                "attribute": "ZCLAttributeDef(id=0x0000, name='upgrade_server_id', type=<class 'zigpy.types.named.EUI64'>, zcl_type=<DataTypeId.EUI64: 240>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",
                "value": null
              },
              "0x000c": {
                "attribute": "ZCLAttributeDef(id=0x000C, name='upgrade_timeout_policy', type=<enum 'UpgradeTimeoutPolicy'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)",
                "value": null
              }
            },
            "unsupported_attributes": []
          }
        }
      }
    }
  }
}

Links:
Quirk: zha-device-handlers/zhaquirks/tuya/ts001x.py at 8b3560ee6d9cc105df7b698cec021ceacf14af1f · zigpy/zha-device-handlers · GitHub

Logs? Traces?

I’d start tochange mode single to mode queued. If you switch quickly, the automtion might still be busy performing the previous action.

If those switches (or some of them) are in detached mode and do not show their state with a led or something, then I would treat those switches as stateless, not sync them and just let them toggle the light on each state change.

Here is log from my testing after I have changed mode to queued as @Edwin_D suggested. Basically I have tried to toogle of them several times until one of them was not sync which happens kinda random I would say. So it did not help at all.

New automation:

alias: Bedroom Light Switches sync
description: Bedroom Light Switches sync
triggers:
  - entity_id:
      - switch.bedroom_door_light_switch
      - switch.tz3000_hafsqare_ts0011_switch
    from:
      - "on"
      - "off"
    to:
      - "on"
      - "off"
    trigger: state
conditions: []
actions:
  - target:
      entity_id:
        - switch.bedroom_door_light_switch
        - switch.tz3000_hafsqare_ts0011_switch
    action: homeassistant.turn_{{ trigger.to_state.state }}
mode: queued
2025-02-02 22:46:30.281 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded
2025-02-02 22:46:31.364 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded
2025-02-02 22:46:34.983 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded
2025-02-02 22:46:36.296 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded
2025-02-02 22:46:37.638 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded
2025-02-02 22:46:42.697 WARNING (MainThread) [homeassistant.components.automation.bedroom_light_switches_sync] Bedroom Light Switches sync: Maximum number of runs exceeded

traces:

{
  "trace": {
    "last_step": "trigger/0",
    "run_id": "e5cd3fd617263a4c05d98feb30652bfc",
    "state": "stopped",
    "script_execution": "failed_max_runs",
    "timestamp": {
      "start": "2025-02-02T21:47:43.120676+00:00",
      "finish": "2025-02-02T21:47:43.121472+00:00"
    },
    "domain": "automation",
    "item_id": "caae03d506af46fba94fb26bff22218b",
    "trigger": "state of switch.bedroom_door_light_switch",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2025-02-02T21:47:43.120886+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.bedroom_light_switches_sync",
              "state": "on",
              "attributes": {
                "id": "caae03d506af46fba94fb26bff22218b",
                "last_triggered": "2025-02-02T21:47:42.982160+00:00",
                "mode": "queued",
                "current": 10,
                "max": 10,
                "friendly_name": "Bedroom Light Switches sync"
              },
              "last_changed": "2025-02-02T21:44:07.209111+00:00",
              "last_reported": "2025-02-02T21:47:42.982221+00:00",
              "last_updated": "2025-02-02T21:47:42.982221+00:00",
              "context": {
                "id": "01JK4A4F052E2G165VSW8SCZYR",
                "parent_id": "01JK4A4C9KZMTV7CXFNSWVYDR6",
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "state",
              "entity_id": "switch.bedroom_door_light_switch",
              "from_state": {
                "entity_id": "switch.bedroom_door_light_switch",
                "state": "on",
                "attributes": {
                  "friendly_name": "Bedroom door light Switch"
                },
                "last_changed": "2025-02-02T21:47:42.751811+00:00",
                "last_reported": "2025-02-02T21:47:42.752408+00:00",
                "last_updated": "2025-02-02T21:47:42.751811+00:00",
                "context": {
                  "id": "01JK4A4BVK3NQJZM261SVESNHG",
                  "parent_id": "01JK4A3DFS5G66TBBZB8Y81Q09",
                  "user_id": null
                }
              },
              "to_state": {
                "entity_id": "switch.bedroom_door_light_switch",
                "state": "off",
                "attributes": {
                  "friendly_name": "Bedroom door light Switch"
                },
                "last_changed": "2025-02-02T21:47:43.119850+00:00",
                "last_reported": "2025-02-02T21:47:43.120345+00:00",
                "last_updated": "2025-02-02T21:47:43.119850+00:00",
                "context": {
                  "id": "01JK4A4C9KZMTV7CXFNSWVYDR6",
                  "parent_id": "01JK4A3DVP2C32TB8DZFP3D4AV",
                  "user_id": null
                }
              },
              "for": null,
              "attribute": null,
              "description": "state of switch.bedroom_door_light_switch"
            }
          }
        }
      ]
    },
    "config": {
      "id": "caae03d506af46fba94fb26bff22218b",
      "alias": "Bedroom Light Switches sync",
      "description": "Bedroom Light Switches sync",
      "triggers": [
        {
          "entity_id": [
            "switch.bedroom_door_light_switch",
            "switch.tz3000_hafsqare_ts0011_switch"
          ],
          "from": [
            "on",
            "off"
          ],
          "to": [
            "on",
            "off"
          ],
          "trigger": "state"
        }
      ],
      "conditions": [],
      "actions": [
        {
          "target": {
            "entity_id": [
              "switch.bedroom_door_light_switch",
              "switch.tz3000_hafsqare_ts0011_switch"
            ]
          },
          "action": "homeassistant.turn_{{ trigger.to_state.state }}"
        }
      ],
      "mode": "queued"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01JK4A4F4G3DBD78JGAATJ9KXK",
      "parent_id": "01JK4A4C9KZMTV7CXFNSWVYDR6",
      "user_id": null
    }
  },
  "logbookEntries": []
}

They actualy have LED which represents their state so their sync should be possible. How would I toogle them without syncing? I think you always need to call turn off on all other switches when one is pressed and same when turn on one of them.
Also maybe another point to consider is that I have changed quirk so they appear as device type switch instead of light.

I’d also try other modes. The thing that may be bugging you is When a flips b, a little later b flips a too. These come later. if a is also manually toggled, things start to get messy. You’d need to know which was manual and which came from your automation if the triggers are not coming in the order you like.

Is it really a situation that happens in real life?

Hi, I will definitely give a it shoot and update it results here. Strange is that sometimes the switch seems to be not responsive at while sometimes it is working perfectly. This also reflected within home assistant and the automation, which does not get triggered. Maybe I can make a video to demonstrate current state to describe it better.

So I have changed mode to “restart” mode. I have tried toogle several times (within 1-2 seconds intervals) using HA interface. It worked okay but between 09:31:51 and 09:32:00 there was huge delay although it was triggered in the end. But weird thing is that toogle at 09:32:00 is actually different then all others while it was done it same way like others.

Anyway testing scenario with mode “restart” was looking ok until moment when an infinity loop occured and switches were toogling on/off when I was pressing within 1 second interval.


Traces:

{
  "trace": {
    "last_step": "action/0",
    "run_id": "9f1bb8ec403890d5de69e8387f73b4ad",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2025-02-05T08:32:16.995812+00:00",
      "finish": "2025-02-05T08:32:17.268756+00:00"
    },
    "domain": "automation",
    "item_id": "caae03d506af46fba94fb26bff22218b",
    "trigger": "state of switch.bedroom_door_light_switch",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2025-02-05T08:32:16.995958+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.bedroom_light_switches_sync",
              "state": "on",
              "attributes": {
                "id": "caae03d506af46fba94fb26bff22218b",
                "last_triggered": "2025-02-05T08:32:16.638310+00:00",
                "mode": "restart",
                "current": 1,
                "friendly_name": "Bedroom Light Switches sync"
              },
              "last_changed": "2025-02-05T08:28:09.084456+00:00",
              "last_reported": "2025-02-05T08:32:16.638363+00:00",
              "last_updated": "2025-02-05T08:32:16.638363+00:00",
              "context": {
                "id": "01JKAKT47X066BSCZV9RMK8KBA",
                "parent_id": "01JKAKT43G4BK8A8850RVDK0F0",
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "state",
              "entity_id": "switch.bedroom_door_light_switch",
              "from_state": {
                "entity_id": "switch.bedroom_door_light_switch",
                "state": "on",
                "attributes": {
                  "friendly_name": "Bedroom door light Switch"
                },
                "last_changed": "2025-02-05T08:32:15.878294+00:00",
                "last_reported": "2025-02-05T08:32:16.034568+00:00",
                "last_updated": "2025-02-05T08:32:15.878294+00:00",
                "context": {
                  "id": "01JKAKT3AA4CMHST9N5TKWZC2H",
                  "parent_id": "01JKAKT35YCEHT1PRQKK6H96AH",
                  "user_id": null
                }
              },
              "to_state": {
                "entity_id": "switch.bedroom_door_light_switch",
                "state": "off",
                "attributes": {
                  "friendly_name": "Bedroom door light Switch"
                },
                "last_changed": "2025-02-05T08:32:16.994945+00:00",
                "last_reported": "2025-02-05T08:32:17.122800+00:00",
                "last_updated": "2025-02-05T08:32:16.994945+00:00",
                "context": {
                  "id": "01JKAKT47X066BSCZV9RMK8KBA",
                  "parent_id": "01JKAKT43G4BK8A8850RVDK0F0",
                  "user_id": null
                }
              },
              "for": null,
              "attribute": null,
              "description": "state of switch.bedroom_door_light_switch"
            }
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2025-02-05T08:32:17.000901+00:00",
          "changed_variables": {
            "context": {
              "id": "01JKAKT4K35QDAM7BC7CBJMCWM",
              "parent_id": "01JKAKT47X066BSCZV9RMK8KBA",
              "user_id": null
            }
          },
          "result": {
            "params": {
              "domain": "homeassistant",
              "service": "turn_off",
              "service_data": {},
              "target": {
                "entity_id": [
                  "switch.bedroom_door_light_switch",
                  "switch.tz3000_hafsqare_ts0011_switch"
                ]
              }
            },
            "running_script": false
          }
        }
      ]
    },
    "config": {
      "id": "caae03d506af46fba94fb26bff22218b",
      "alias": "Bedroom Light Switches sync",
      "description": "Bedroom Light Switches sync",
      "triggers": [
        {
          "entity_id": [
            "switch.bedroom_door_light_switch",
            "switch.tz3000_hafsqare_ts0011_switch"
          ],
          "from": [
            "on",
            "off"
          ],
          "to": [
            "on",
            "off"
          ],
          "trigger": "state"
        }
      ],
      "conditions": [],
      "actions": [
        {
          "target": {
            "entity_id": [
              "switch.bedroom_door_light_switch",
              "switch.tz3000_hafsqare_ts0011_switch"
            ]
          },
          "action": "homeassistant.turn_{{ trigger.to_state.state }}"
        }
      ],
      "mode": "restart"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01JKAKT4K35QDAM7BC7CBJMCWM",
      "parent_id": "01JKAKT47X066BSCZV9RMK8KBA",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": "Bedroom Light Switches sync",
      "message": "triggered by state of switch.bedroom_door_light_switch",
      "source": "state of switch.bedroom_door_light_switch",
      "entity_id": "automation.bedroom_light_switches_sync",
      "context_id": "01JKAKT4K35QDAM7BC7CBJMCWM",
      "domain": "automation",
      "when": 1738744337.0004954
    }
  ]
}

Automation

alias: Bedroom Light Switches sync
description: Bedroom Light Switches sync
triggers:
  - entity_id:
      - switch.bedroom_door_light_switch
      - switch.tz3000_hafsqare_ts0011_switch
    from:
      - "on"
      - "off"
    to:
      - "on"
      - "off"
    trigger: state
conditions: []
actions:
  - target:
      entity_id:
        - switch.bedroom_door_light_switch
        - switch.tz3000_hafsqare_ts0011_switch
    action: homeassistant.turn_{{ trigger.to_state.state }}
mode: restart

Hi, so I have tested for a week and I have also tried to implement it in room where are 3 switches. When using “restart” mode, I am getting so far the best resutls althought it is not still working 100 percent of time. For example in room with two switches sometimes it happens that switch I used to turn on light correctly triggers the other one but then unfortunatelly later it completely stop responding (like it was not triggered at all). In room with three switches in case all switches were triggered on and later when I toogle it off it sometimes happens that they are turn on again. Any other ideas what could be factor that is affecting behaviour of devices? I am not sure if there for example some device profile that would change device responsivity and so. Many thanks

I am pretty sure it cannot be solved because of timing and the fact that you do not know why a switch toggles. If you turn the light on, and then off before the others have toggled too, the others will try to sync as well and turn the first switch back on, thereby negating the manual off command.

The question remains: is this a problem in real life or are you just trying to achieve perfection that is not needed. If anyone on my home would flip switches like crazy, I’d tell them to stop. If they continued there would be repercussions that are worse than out of sync switches.

I understand what you mean but issue happens as said kinda random. Crazy interaction with switch is not needed. It happens completely random while using it “normaly” that means that sometimes 2nd switch is not triggered.

That just sounds like the mesh is not stable. Even with some interference there should be some retry attempts.

In fact, an automation like this has inbuilt retries. If it is a single toggle, all three lights, if successful, will attempt to switch the other ones as well. It only stops because HA will not trigger again if the state does not change.

So the problem that needs solving is messages getting lost even though the action is called.

A slight pause between actions would diminish the risk of collisions but that is not wat you want with your lights responding late. Maybe first try all, then after that each one individually with pauses between as a failsafe. Until you fix the real cause…

Or try to create a native zigbee group to switch them at once.

@Edwin_D basically I tried zigbee native groups and many more but still no luck. I have moved to room where I have three switches to inlustrate it better. I have wrote my own automation and also number helper which basically should tell system which switch was the one that have triggered others.

number helper description:
0 - no switch should be on (happens whenever switches are on and someone pressed any of them)
1 - first switch was switch to trigger rest
2 - second switch was switch to trigger rest
3 - third switch was switch to trigger rest

Issue is sometimes just one of switches is not get triggered by automation (I believe home assistant is not able to access it at moment for some reason - no idea why).

Switch on automation example

alias: " Marek testing new 5"
description: ""
triggers:
  - entity_id:
      - switch.tz3000_hafsqare_ts0011_switch_5
    to: "on"
    trigger: state
conditions:
  - condition: template
    value_template: "{{ trigger.to_state.context.user_id is none }}"
  - condition: state
    entity_id: input_number.hallway_activator
    state: "0.0"
actions:
  - action: input_number.set_value
    metadata: {}
    data:
      value: 1
    target:
      entity_id: input_number.hallway_activator
  - action: switch.turn_on
    data: {}
    target:
      entity_id:
        - switch.tz3000_hafsqare_ts0011_switch_3
        - switch.tz3000_hafsqare_ts0011_switch_4
mode: queued
max: 10

Switch off automation example

alias: Marek testing new 6
description: ""
triggers:
  - entity_id:
      - switch.tz3000_hafsqare_ts0011_switch_5
    to: "off"
    trigger: state
conditions:
  - condition: template
    value_template: "{{ trigger.to_state.context.user_id is none }}"
actions:
  - action: input_number.set_value
    metadata: {}
    data:
      value: 0
    target:
      entity_id: input_number.hallway_activator
  - action: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.tz3000_hafsqare_ts0011_switch_3
        - switch.tz3000_hafsqare_ts0011_switch_4
mode: queued
max: 10

Log when it did not work (tz3000_hafsqare_ts0011_switch_3 was not turned off.

{
  "trace": {
    "last_step": "action/1",
    "run_id": "ec88bf68152ea106aa33198c669d6f50",
    "state": "running",
    "script_execution": null,
    "timestamp": {
      "start": "2025-02-16T15:10:52.295209+00:00",
      "finish": null
    },
    "domain": "automation",
    "item_id": "1739706917882",
    "trigger": "state of switch.tz3000_hafsqare_ts0011_switch_5",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2025-02-16T15:10:52.295405+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.marek_testing_new_6",
              "state": "on",
              "attributes": {
                "id": "1739706917882",
                "last_triggered": "2025-02-16T15:10:46.193613+00:00",
                "mode": "queued",
                "current": 0,
                "max": 10,
                "friendly_name": "Marek testing new 6"
              },
              "last_changed": "2025-02-16T15:09:49.267666+00:00",
              "last_reported": "2025-02-16T15:10:46.826814+00:00",
              "last_updated": "2025-02-16T15:10:46.826814+00:00",
              "context": {
                "id": "01JM7MZPDGRNHRFBP92BXQF7GD",
                "parent_id": "01JM7MZPDEKV1KDVER6YGJJG60",
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "state",
              "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
              "from_state": {
                "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
                "state": "on",
                "attributes": {
                  "friendly_name": "Hallway exit door switch Switch"
                },
                "last_changed": "2025-02-16T15:10:49.276234+00:00",
                "last_reported": "2025-02-16T15:10:49.276234+00:00",
                "last_updated": "2025-02-16T15:10:49.276234+00:00",
                "context": {
                  "id": "01JM7MZSDWY4QM7TM8HF1NWK54",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "to_state": {
                "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
                "state": "off",
                "attributes": {
                  "friendly_name": "Hallway exit door switch Switch"
                },
                "last_changed": "2025-02-16T15:10:52.292983+00:00",
                "last_reported": "2025-02-16T15:10:52.292983+00:00",
                "last_updated": "2025-02-16T15:10:52.292983+00:00",
                "context": {
                  "id": "01JM7MZWC4WGY1GD1EFXCC2QG2",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "for": null,
              "attribute": null,
              "description": "state of switch.tz3000_hafsqare_ts0011_switch_5"
            }
          }
        }
      ],
      "condition/0": [
        {
          "path": "condition/0",
          "timestamp": "2025-02-16T15:10:52.295512+00:00",
          "result": {
            "result": true,
            "entities": []
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2025-02-16T15:10:52.296844+00:00",
          "changed_variables": {
            "context": {
              "id": "01JM7MZWC7JGY66VZB3JACDJS1",
              "parent_id": "01JM7MZWC4WGY1GD1EFXCC2QG2",
              "user_id": null
            }
          },
          "result": {
            "params": {
              "domain": "input_number",
              "service": "set_value",
              "service_data": {
                "value": 0,
                "entity_id": [
                  "input_number.hallway_activator"
                ]
              },
              "target": {
                "entity_id": [
                  "input_number.hallway_activator"
                ]
              }
            },
            "running_script": false
          }
        }
      ],
      "action/1": [
        {
          "path": "action/1",
          "timestamp": "2025-02-16T15:10:52.298695+00:00",
          "result": {
            "params": {
              "domain": "switch",
              "service": "turn_off",
              "service_data": {},
              "target": {
                "entity_id": [
                  "switch.tz3000_hafsqare_ts0011_switch_3",
                  "switch.tz3000_hafsqare_ts0011_switch_4"
                ]
              }
            },
            "running_script": false
          }
        }
      ]
    },
    "config": {
      "id": "1739706917882",
      "alias": "Marek testing new 6",
      "description": "",
      "triggers": [
        {
          "entity_id": [
            "switch.tz3000_hafsqare_ts0011_switch_5"
          ],
          "to": "off",
          "trigger": "state"
        }
      ],
      "conditions": [
        {
          "condition": "template",
          "value_template": "{{ trigger.to_state.context.user_id is none }}"
        }
      ],
      "actions": [
        {
          "action": "input_number.set_value",
          "metadata": {},
          "data": {
            "value": 0
          },
          "target": {
            "entity_id": "input_number.hallway_activator"
          }
        },
        {
          "action": "switch.turn_off",
          "data": {},
          "target": {
            "entity_id": [
              "switch.tz3000_hafsqare_ts0011_switch_3",
              "switch.tz3000_hafsqare_ts0011_switch_4"
            ]
          }
        }
      ],
      "mode": "queued",
      "max": 10
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01JM7MZWC7JGY66VZB3JACDJS1",
      "parent_id": "01JM7MZWC4WGY1GD1EFXCC2QG2",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": "Marek testing new 6",
      "message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "entity_id": "automation.marek_testing_new_6",
      "context_id": "01JM7MZWC7JGY66VZB3JACDJS1",
      "domain": "automation",
      "when": 1739718652.296162
    },
    {
      "state": "0.0",
      "entity_id": "input_number.hallway_activator",
      "when": 1739718652.2982554,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": "Marek testing new 6",
      "context_message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_entity_id": "automation.marek_testing_new_6"
    },
    {
      "state": "off",
      "entity_id": "switch.tz3000_hafsqare_ts0011_switch_4",
      "when": 1739718652.527699,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": "Marek testing new 6",
      "context_message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_entity_id": "automation.marek_testing_new_6"
    }
  ]
}

After while tz3000_hafsqare_ts0011_switch_3 turn off and immediately on triggering other automation while keeping other two switches offline due they state was off:

{
  "trace": {
    "last_step": "action/1",
    "run_id": "2f27c660a81ef34a0bc96499d5d5ac98",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2025-02-16T15:11:11.357793+00:00",
      "finish": "2025-02-16T15:11:17.923615+00:00"
    },
    "domain": "automation",
    "item_id": "1739706870992",
    "trigger": "state of switch.tz3000_hafsqare_ts0011_switch_5",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2025-02-16T15:11:11.357975+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.marek_testing_new_5",
              "state": "on",
              "attributes": {
                "id": "1739706870992",
                "last_triggered": "2025-02-16T15:10:49.279592+00:00",
                "mode": "queued",
                "current": 1,
                "max": 10,
                "friendly_name": " Marek testing new 5"
              },
              "last_changed": "2025-02-16T15:09:49.781560+00:00",
              "last_reported": "2025-02-16T15:10:49.279687+00:00",
              "last_updated": "2025-02-16T15:10:49.279687+00:00",
              "context": {
                "id": "01JM7MZSDY9ZMVE4FCJVQSXPR1",
                "parent_id": "01JM7MZSDWY4QM7TM8HF1NWK54",
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "state",
              "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
              "from_state": {
                "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
                "state": "off",
                "attributes": {
                  "friendly_name": "Hallway exit door switch Switch"
                },
                "last_changed": "2025-02-16T15:10:52.292983+00:00",
                "last_reported": "2025-02-16T15:10:52.292983+00:00",
                "last_updated": "2025-02-16T15:10:52.292983+00:00",
                "context": {
                  "id": "01JM7MZWC4WGY1GD1EFXCC2QG2",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "to_state": {
                "entity_id": "switch.tz3000_hafsqare_ts0011_switch_5",
                "state": "on",
                "attributes": {
                  "friendly_name": "Hallway exit door switch Switch"
                },
                "last_changed": "2025-02-16T15:11:11.355695+00:00",
                "last_reported": "2025-02-16T15:11:11.355695+00:00",
                "last_updated": "2025-02-16T15:11:11.355695+00:00",
                "context": {
                  "id": "01JM7N0EZVX3QFAX1WA2ZP5YE8",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "for": null,
              "attribute": null,
              "description": "state of switch.tz3000_hafsqare_ts0011_switch_5"
            }
          }
        }
      ],
      "condition/0": [
        {
          "path": "condition/0",
          "timestamp": "2025-02-16T15:11:11.358069+00:00",
          "result": {
            "result": true,
            "entities": []
          }
        }
      ],
      "condition/1": [
        {
          "path": "condition/1",
          "timestamp": "2025-02-16T15:11:11.358578+00:00",
          "result": {
            "result": true
          }
        }
      ],
      "condition/1/entity_id/0": [
        {
          "path": "condition/1/entity_id/0",
          "timestamp": "2025-02-16T15:11:11.358655+00:00",
          "result": {
            "result": true,
            "state": "0.0",
            "wanted_state": "0.0"
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2025-02-16T15:11:17.731648+00:00",
          "changed_variables": {
            "context": {
              "id": "01JM7N0EZXCDVRKECSEH2HP1E0",
              "parent_id": "01JM7N0EZVX3QFAX1WA2ZP5YE8",
              "user_id": null
            }
          },
          "result": {
            "params": {
              "domain": "input_number",
              "service": "set_value",
              "service_data": {
                "value": 1,
                "entity_id": [
                  "input_number.hallway_activator"
                ]
              },
              "target": {
                "entity_id": [
                  "input_number.hallway_activator"
                ]
              }
            },
            "running_script": false
          }
        }
      ],
      "action/1": [
        {
          "path": "action/1",
          "timestamp": "2025-02-16T15:11:17.733458+00:00",
          "result": {
            "params": {
              "domain": "switch",
              "service": "turn_on",
              "service_data": {},
              "target": {
                "entity_id": [
                  "switch.tz3000_hafsqare_ts0011_switch_3",
                  "switch.tz3000_hafsqare_ts0011_switch_4"
                ]
              }
            },
            "running_script": false
          }
        }
      ]
    },
    "config": {
      "id": "1739706870992",
      "alias": " Marek testing new 5",
      "description": "",
      "triggers": [
        {
          "entity_id": [
            "switch.tz3000_hafsqare_ts0011_switch_5"
          ],
          "to": "on",
          "trigger": "state"
        }
      ],
      "conditions": [
        {
          "condition": "template",
          "value_template": "{{ trigger.to_state.context.user_id is none }}"
        },
        {
          "condition": "state",
          "entity_id": "input_number.hallway_activator",
          "state": "0.0"
        }
      ],
      "actions": [
        {
          "action": "input_number.set_value",
          "metadata": {},
          "data": {
            "value": 1
          },
          "target": {
            "entity_id": "input_number.hallway_activator"
          }
        },
        {
          "action": "switch.turn_on",
          "data": {},
          "target": {
            "entity_id": [
              "switch.tz3000_hafsqare_ts0011_switch_3",
              "switch.tz3000_hafsqare_ts0011_switch_4"
            ]
          }
        }
      ],
      "mode": "queued",
      "max": 10
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01JM7N0EZXCDVRKECSEH2HP1E0",
      "parent_id": "01JM7N0EZVX3QFAX1WA2ZP5YE8",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": " Marek testing new 5",
      "message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "entity_id": "automation.marek_testing_new_5",
      "context_id": "01JM7N0EZXCDVRKECSEH2HP1E0",
      "domain": "automation",
      "when": 1739718671.3588917
    },
    {
      "state": "1.0",
      "entity_id": "input_number.hallway_activator",
      "when": 1739718677.7329667,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": " Marek testing new 5",
      "context_message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_entity_id": "automation.marek_testing_new_5"
    },
    {
      "state": "on",
      "entity_id": "switch.tz3000_hafsqare_ts0011_switch_4",
      "when": 1739718677.9051054,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": " Marek testing new 5",
      "context_message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_entity_id": "automation.marek_testing_new_5"
    },
    {
      "state": "off",
      "entity_id": "switch.tz3000_hafsqare_ts0011_switch_4",
      "when": 1739718681.571977,
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": " Marek testing new 5",
      "context_message": "triggered by state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_source": "state of switch.tz3000_hafsqare_ts0011_switch_5",
      "context_entity_id": "automation.marek_testing_new_5"
    }
  ]
}

Trying to see which switch caused the change does not help. Because when you switch one and you try to sync the other switches, those switches also become a cause of changes for the others. So one switch being toggled causes at least three automation runs, each performing 3 (or two) actions. If you manually switch again quickly, the ones caused by that one mix in with the previous ones… Avalaunch effect.

But if already the first toggle misses commands. That is why I said you have communication problems, most likely interference. No amount of changing automations is going to fix that. You need to look at why messages get lost in your mesh.

@Edwin_D Okay, could you please recommend how should I track why and when the message is lost? I have not done this before honestly and from logs and traces I can not detect any issue. Thank you.

Also I have found this, which used to work with smart life app: Multi-Control Linkage-Smart App SDK-Tuya Developer

AThe Home assistent Cookbook has many articles on Zigbee and what you should do to get a stable mesh. Most common problems are not using an extension cord to keep the coordinator away from interference (e.g. from USB3 and other sources), picking a channel that is too crowded, not using enough Zigbee routing devices and more. The best place to start is probably this cookbook article:

One of the problems is that inbuilt switches are in a bad spot to begin with, inside a wall and surrounded by power cables…

@Edwin_D thank you for suggestions. I have tried a few things mentioned in the guidelines but I think I am more or less following them. Also as mentioned earlier it would worked totally fine with previous solution (smartlife multi control association). What I did:

  1. I have check signal strenghts - seems okay to me

  2. I have also openned issue on quirk level
    [BUG] Bseed switches linking · Issue #3883 · zigpy/zha-device-handlers · GitHub

  3. There is video how switches are behaving
    https://photos.app.goo.gl/6itN8Ta7V3KK6P7G6

@Edwin_D reporting with current status

I have been busy with following things. However I am still facing the issue.

  1. I have completely erased my zigbee network and started again from scratch.

  2. I have noticed that my coordinator firmware was not running the latest firmware so I did and update and now I am running on 7.4.4.0 build 0.

  3. Previously my zigbee network had more than 60 devices. Even now with only 10 devices issue persist. Distance between endpoint devices (switches) and coordinator is quite small. I have also powerful routers which should help building stable mesh.

  4. Not sure if is it any important but I took a look to my previous gateway and its baudrate is 38400 while current coordinator (I have home assistant yellow) works on 111520.

Regarding coordinator only ideas how to improve it would be to disable wifi and bluetooth of CM4 to lower interference. But my previous gateway also had bluetooth and wifi and it was enabled. Any other ideas?

Based on these findings I think it is either problem with current coordinator or quirk but I think it is more quirk related since I do not have the issue with any other device.

While also searching for any other useful information I have found following discussion and they are explicitly mentioning issues with this type of device while using different quirks - I will try those once I get home.

Again as before I am really greatful for your time and advices

Marek

I’m not Zigbee’s biggest fan because of these kinds of problems, and I had them on completely different hard- and software configurations too. But I did get a stable mesh using devices others find problematic. But It would be an overstatement to say I’m an expert on fixing these things.

The best way to reduce interference is a USB coordinator on an extension wire, in a place away from other transmitters, especially the 2.4GHz ones. If you’ve gone as far as to wipe the mesh, I would experiment with different channels. I think for me that was the biggest culprit. Be aware Zigbee channels use different numbers than wifi does, so use a guide that shows the differences graphically. Pair routing devices first, pair them in the place you intend to use them. Start pairing the ones close to the coordinator and move outward in circles.

More router devices is always better than less. Never take router devices off power. Give the mesh some time to settle: evices might look for better routes if they fail at first. That is about as much as I know.

As far as I know quirks either work or they don’t. I think they are used to identify non standard clusters and ty them to sensors or commands. I do not think they do much else so they are not likely to influence communication quality.