Smart plug on-off pairing script for the very difficult to pair Benexmart dual white filament bulbs

My cc2531 zigbee coordinator got fried last weekend together with another device, presumably due to some kind of power surge. So I’m in the process of re-pairing all my devices.

The Benexmart A60, ST64, or G95 (Zigbee ID: “TS0502B”; “_TZ3210_psgq7ysz” TS0502A) (also sold under the brand zemismart) turned out to be extremely difficult to get into pairing mode. I didn’t bother keeping the manual, so I turned to google and found complaints about this in Amazon reviews and on Aliexpress. Some reviews said they took hours.

I have 4 of these bulbs… If I’d even be able to get one to pair, I’m pretty sure I wouldn’t be able to remember the exact way I played around with the light switch.

So I used a zigbee smart plug and made a small script in home assistant to be able to strategically approach this and make sure I could replicate if if I found a working method.

Here is the script yaml (you'll need to create the helpers yourself):
alias: Pair benexmart bulbs
sequence:
  - service: switch.turn_off
    data: {}
    target:
      device_id: 61b476ce2040dcc59808fb84bdcf70c8
  - delay:
      hours: 0
      minutes: 0
      seconds: '{{ states(''input_number.benexmart_initial_off_time'') | float(1) }}'
      milliseconds: 0
  - repeat:
      while:
        - condition: template
          value_template: >-
            {{ repeat.index <= (states('input_number.benexmart_switch_times') |
            int(0)) }}
      sequence:
        - service: switch.turn_on
          data: {}
          target:
            device_id: 61b476ce2040dcc59808fb84bdcf70c8
        - delay:
            hours: 0
            minutes: 0
            seconds: '{{ states(''input_number.benexmart_on_time'') | float(1) }}'
            milliseconds: 0
        - service: switch.turn_off
          data: {}
          target:
            device_id: 61b476ce2040dcc59808fb84bdcf70c8
        - delay:
            hours: 0
            minutes: 0
            seconds: '{{ states(''input_number.benexmart_off_time'') | float(1) }}'
            milliseconds: 0
  - service: switch.turn_on
    data: {}
    target:
      device_id: 61b476ce2040dcc59808fb84bdcf70c8
  - service: notify.persistent_notification
    data:
      message: done
mode: single
icon: mdi:lightbulb-auto

On the dashboard i played around with this.
image

Dashboard card yaml
type: vertical-stack
cards:
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: toggle
    entity: switch.smart_plug_on_off
    icon_height: 40px
    show_state: true
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: toggle
    entity: script.pair_benexmart_bulbs
    icon_height: 40px
    show_state: true
  - type: entities
    entities:
      - entity: input_number.benexmart_initial_off_time
      - entity: input_number.benexmart_off_time
      - entity: input_number.benexmart_on_time
      - entity: input_number.benexmart_switch_times

The bulbs themselves are totally worth it. Haven’t found any better cheap bulbs that are able to produce light THIS warm. Just a total pain to pair. Hopefully this is useful for someone.

2 Likes

After many hours of trying to re-pair my Benexmart filament bulbs, I was about to try this script when they all, one by one, just went into pairing mode when turned back on. I think for my case they automatically went into pairing mode from after being completely unpowered for about 30 minutes.