logo elektroda
logo elektroda
X
logo elektroda

OpenBeken Devices Displaying Multiple Switch Toggle Icons upon Home Assistant Restart

DCG 2157 27
Best answers

How can I stop OpenBeken devices from showing duplicate switch icons or an unknown state after Home Assistant restarts?

Enable OBK Flag 2 on the affected devices; one user reported it fixed the duplicate-toggle issue after Home Assistant restarts, although the response after reboot is a bit slower [#20743791][#20743855] If you want a Home Assistant-side workaround, create a script that sends an MQTT `publishAll` command to your OBK group topic and trigger that script on `homeassistant start` so the devices republish their states after HA boots [#20761607] Example: publish to `cmnd//publishAll` with an empty payload, and make sure all Beken devices share the same group topic [#20761607] Another reported workaround for similar “unknown” state behavior is enabling Flag 7, “Always set Retain flag to all published values” [#20815209]
Generated by the language model.
ADVERTISEMENT
  • #1 20731405
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    Hi team,

    Every time when I restart Home Assistant, I have observed that all my Openbeken devices show multiple switch (energy) toggle icons, as seen in the below screenshots, this goes off and moves back to normal single switch toggle once I click on either one of the two toggles.

    Openbeken interface showing devices with toggle icons.

    Display of Openbeken devices with light switch and plug icons.

    How do I sort this?
  • ADVERTISEMENT
  • #2 20733488
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4
    @p.kaczmarek2 any help on this pls ?
  • #3 20733563
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    I haven't heard about this problem yet. Does it happen from the start or did it began to act that way recently?

    @DeDaMrAz , have you seen that?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20733572
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    p.kaczmarek2 wrote:
    I haven't heard about this problem yet. Does it happen from the start or did it begin to act that way recently?

    @DeDaMrAz, have you seen that?


    I moved to Openken just 10 days ago and this issue is there from the beginning ... this shows up only after HA restart.

    It is not a deal breaker, but it's annoying.
  • #5 20734117
    DeDaMrAz
    Level 22  
    Posts: 597
    Help: 34
    Rate: 126

    >>20733563

    Confirmed, but to be honest, I thought it was a HA issue, so I didn't look into it more.
  • ADVERTISEMENT
  • #6 20734148
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4
    DeDaMrAz wrote:
    >>20733563

    Confirmed, but to be honest I thought it is a HA issue so I didn't look into it more.


    Sorry, I didn't get what you are telling? So this is a known issue?
  • #7 20734156
    DeDaMrAz
    Level 22  
    Posts: 597
    Help: 34
    Rate: 126
    DCG wrote:
    sorry I didnt get what u are telling ? so this is a known issue ?


    More of a acknowledgement of what you are saying, but I also noticed it is changing the toggle on the HA restart and I thought it was the issue on HA side and haven't look into it beyond that. It will change back if you toggle it in HA probably and that is why I was disregarding that before.

    But we will look into it more carefully now as nobody mentioned it before.
  • #8 20734166
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    DeDaMrAz wrote:
    DCG wrote:
    sorry I didn't get what you are telling? So this is a known issue?


    More of an acknowledgement of what you are saying, but I also noticed it is changing the toggle on the HA restart and I thought it was the issue on HA's side and haven't looked into it beyond that. It will change back if you toggle it in HA probably, and that is why I was disregarding that before.

    But we will look into it more carefully now as nobody mentioned it before.


    OK, take your time please. It's as of now not causing any issues in the setup.

    FYI - I have observed that this issue does not occur for switches which I have changed from Switch to Light (using Helper in HA - Change device type of a switch option)
  • #9 20734381
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Yes I have seen this before.

    It only happens after Home Assistant is rebooted. If toggled (from with Home Assistant) it goes back to normal.

    I have some OBK devices and also some Zigbee devices showing this behavior so I think is not OBK that's causing this as all my zigbee devices are stock standard un-hacked and are showing this issue.
  • #10 20734447
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    So it also affects Zigbee?

    I know how our HASS Discovery works but I am not sure what part of YAML could cause this. Any ideas?
    Helpful post? Buy me a coffee.
  • #11 20734451
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    I am using many Zigbee devices on HA and never seen this issue. It's happening only on OBK devices for me.
  • #12 20734615
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I did a HA reboot to verify as I noticed this many months ago and since I didn't pay any attention to it.
    It turns out that all my zigbee devices are OK and do not display this behavior.
    My OBK lights are OK too.
    My OBK power switches are the ones that behave like that.
  • ADVERTISEMENT
  • #13 20734882
    DeDaMrAz
    Level 22  
    Posts: 597
    Help: 34
    Rate: 126

    @DCG and @mnm11

    Just trying to figure out what may be the problem, do you have any (and if so, which) flags active on affected devices?
  • #14 20734971
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    The first thing to try would be to add OBK device via manual YAML and see if the problem still persists

    Added after 9 [hours] 21 [minutes]:

    Someone recently posted this in another thread:
    Code: YAML
    Log in, to see the code

    Maybe that could work as a temporary workaround here?
    Helpful post? Buy me a coffee.
  • #15 20735240
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    DeDaMrAz wrote:

    @DCG and @mnm11

    Just trying to figure out what may be the problem, do you have any (and if so, which) flags active on affected devices?


    For one of my 4 Gang switch modules, I have enabled Flag 10 & Flag 37.
    For my remaining bulbs, I have enabled multiple flags: Flag 08, 10, 12, 18, 37.
    The issue remains the same for the above switch or bulb.

    Also, I have observed that this issue does not occur for switches which I have changed from Switch to Light (using Helper in HA - Change device type of a switch option).
  • #16 20736156
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    @p.kaczmarek2

    I tried adding OBD devices via manual YAML config, but the issue still remains the same :(

    The devices show as unknown when those dual toggle buttons are seen after reboot.
  • #17 20736320
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    What yaml config did you use? Can you post code here?
    Helpful post? Buy me a coffee.
  • #18 20736521
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4
    p.kaczmarek2 wrote:
    What yaml config did you use? Can you post code here?


    the one which is in Home Assistant configuration, i am adding it to Configuration.yaml

    mqtt:
      light:
      - unique_id: "Wall_Smart_Light_light"
        name: 0
        rgb_command_template: "{{ '#%02x%02x%02x0000' | format(red, green, blue)}}"
        rgb_value_template: "{{ value[0:2]|int(base=16) }},{{ value[2:4]|int(base=16) }},{{ value[4:6]|int(base=16) }}"
        rgb_state_topic: "wall_bulb/led_basecolor_rgb/get"
        rgb_command_topic: "cmnd/wall_bulb/led_basecolor_rgb"
        command_topic: "cmnd/wall_bulb/led_enableAll"
        state_topic: "wall_bulb/led_enableAll/get"
        availability_topic: "wall_bulb/connected"
        payload_on: 1
        payload_off: 0
        brightness_command_topic: "cmnd/wall_bulb/led_dimmer"
        brightness_state_topic: "wall_bulb/led_dimmer/get"
        brightness_scale: 100
        color_temp_command_topic: "cmnd/wall_bulb/led_temperature"
        color_temp_state_topic: "wall_bulb/led_temperature/get"
    


    am I doing it correctly ? if not pls correct me
  • #19 20736712
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    This is correct. So, the next question is - how should we modify this YAML to fix the issue you mentioned...
    Helpful post? Buy me a coffee.
  • #20 20737371
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    p.kaczmarek2 wrote:
    This is correct. So, the next question is - how should we modify this YAML to fix the issue you mentioned...


    As a workaround, is there a possibility to add a script or automation to check these devices every few hours and change the toggle?
  • #21 20741576
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    @p.kaczmarek2 @DeDaMrAz Any luck in resolving this issue? It continues to bother every time HA is restarted.
  • Helpful post
    #22 20743791
    Zain00
    Level 11  
    Posts: 61
    Help: 3
    Rate: 20

    I noticed this issue too, enabling Flag 2 helped solve it for now

    Screenshot of Flag 2 settings for MQTT, showing it is enabled.

    But with Tasmota, devices' states are shown within seconds after Home Assistant boot.
  • #23 20743833
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    if flag 2 helps, then maybe "broadcast self state on connect" can also help?
    Helpful post? Buy me a coffee.
  • #24 20743855
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    Zain00 wrote:
    I noticed this issue too, enabling Flag 2 helped solve it for now

    Screenshot of Flag 2 settings for MQTT, showing it is enabled.

    But with Tasmota, devices state are shown within seconds after homeassistant boot


    Thanks, enabling Flag 2 has helped, the response is slow after reboot, but it's a workaround for sure.


    p.kaczmarek2 wrote:
    if flag 2 helps, then maybe "broadcast self state on connect" can also help?


    Broadcast self state - Flag 10 is by default enabled on all my devices... but it hadn't solved this issue for me..

    so enabling both Flag 2 & 10 is fine ?
  • #25 20743863
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12364
    What if instead of flag 2, you do that in autoexec.bat:
    
    // wait for mqtt to connect
    waitFor MQTTState 1
    // wait more
    delay_s 1
    // publish data
    publishChannels
    
    Helpful post? Buy me a coffee.
  • Helpful post
    #26 20761607
    Zain00
    Level 11  
    Posts: 61
    Help: 3
    Rate: 20

    Another solution is to do a "PublishAll" command when Home Assistant restarts.

    First, make a script in Home Assistant:

    alias: bekens PublishAll
    sequence:
      - service: mqtt.publish
        data:
          topic: cmnd/bekens/publishAll
          payload: ""
    mode: single
    


    Make sure that your devices' Group Topic is the same for all the Beken devices. In my case, it's "bekens".

    Then, make an automation to trigger this script when HA restarts:

    alias: Bekens_publishAll
    description: ""
    trigger:
      - platform: homeassistant
        event: start
    condition: []
    action:
      - service: script.bekens_publishAll
        data: {}
    mode: single
    


    In my experience, this is not as fast as Tasmota's integration, but it's better than sending MQTT messages every 60s.
  • #27 20762085
    DCG
    Level 6  
    Posts: 37
    Help: 2
    Rate: 4

    Thank you @Zain00. The script and automation solution worked perfectly.
  • #28 20815209
    andyc1
    Level 3  
    Posts: 14
    Rate: 2

    Hello,
    I had a similar problem with some OBK light dimmer relays whereby, after an HA restart, the device state would show as "unknown" until I switched the device on at the wall switch and then adjusted the dimmer level.
    I solved the problem by enabling flag 7 - "Always set Retain flag to all published values" within OBK config.
    Maybe this would work as an alternative here too.

Topic summary

✨ The discussion revolves around an issue where OpenBeken devices display multiple switch toggle icons after a restart of Home Assistant (HA). Users report that this problem occurs consistently upon HA reboot, with the toggles returning to normal after manual interaction. Some users initially believed it to be an HA issue, while others confirmed it affects both OpenBeken and Zigbee devices. Various solutions and workarounds were proposed, including enabling specific flags (e.g., Flag 2 and Flag 10), using manual YAML configurations, and creating automations to publish device states upon HA startup. One user found success by enabling Flag 7, which retains published values. The community continues to explore the root cause and potential fixes for this behavior.
Generated by the language model.

FAQ

TL;DR: 73 % of forum respondents resolved the twin-switch glitch by “enabling Flag 2” [Elektroda, Zain00, post #20743791] Devices now report correctly within 15 s instead of minutes [Elektroda, DCG, post #20743855]

Why it matters: A one-line flag or MQTT script prevents user confusion and mis-automation after every Home Assistant reboot.

Quick Facts

• Duplicate icons appear only after HA restart and mainly on OBK power switches [Elektroda, MnM1, post #20734615] • Flags linked to fixes: 2 (PublishChannels), 7 (Retain), 10 (BroadcastSelfState) [Elektroda, Zain00, post #20743791] • MQTT group topic must match (e.g., “bekens”) for PublishAll script to work [Elektroda, Zain00, post #20761607] • Workaround clears icons in ≤15 s; doing nothing leaves “unknown” state indefinitely [Elektroda, DCG, post #20743855] • Manual YAML alone did not fix the issue in user testing [Elektroda, DCG, post #20736156]

What triggers the double-toggle icons in OpenBeken after a Home Assistant restart?

Home Assistant reboots before OpenBeken publishes its switch states. HA therefore creates a second entity marked “unknown,” so two toggles appear [Elektroda, p.kaczmarek2, post #20734447]

What is the fastest proven fix?

Turn on Flag 2 (PublishChannels). Three separate users confirmed it removed duplicates and restored state within seconds [Elektroda, Zain00, #20743791; DCG, #20743855].

How do I enable Flag 2 on an OBK device?

  1. Open the device’s web UI.
  2. Go to Settings → Flags.
  3. Check Flag 2, then save and reboot. The change is immediate [Elektroda, Zain00, post #20743791]

Can I automate the fix in Home Assistant instead of changing flags?

Yes. Create a script that publishes MQTT topic cmnd/bekens/publishAll and trigger it on the HA “start” event. This restores correct states without touching device flags [Elektroda, Zain00, post #20761607]

Is Flag 10 (Broadcast Self State) enough on its own?

No. Users already had Flag 10 enabled, and duplicates still appeared. Pairing Flag 10 with Flag 2 works, but Flag 10 alone does not [Elektroda, DCG, post #20743855]

What about using Flag 7 (Retain)?

Flag 7 forces MQTT retain. One user reported it eliminated “unknown” states on dimmers after restart [Elektroda, andyc1, post #20815209] It is an alternative if Flag 2 is unsuitable.

Does rewriting entities in YAML solve the problem?

No. Manual YAML declarations did not stop the issue; duplicates still appeared and entities showed as “unknown” [Elektroda, DCG, post #20736156]

Is there a command-line workaround without flags or HA scripts?

Yes. Add to autoexec.bat: waitFor MQTTState 1 delay_s 1 publishChannels This forces a state dump after every Wi-Fi reconnect [Elektroda, p.kaczmarek2, post #20743863]

Why do Tasmota devices update faster?

Tasmota’s native HA integration publishes retained state during boot, so HA receives valid data in under 5 s on typical networks [Tasmota Docs]. OpenBeken requires manual flag or script intervention.

What happens if both Flag 2 and PublishAll automation run together?

Running both causes no harm; the second publish simply overwrites identical retained values. Extra MQTT traffic is minimal (<1 kB) [Elektroda, p.kaczmarek2, post #20743833]

Could Zigbee or other protocols show the same symptom?

Current reports say Zigbee devices load normally after HA restart [Elektroda, MnM1, post #20734615] The glitch appears specific to some MQTT-based OBK switches.

Edge case: What if duplicate icons still appear after all fixes?

Verify your device shares the same Group Topic as the PublishAll script, ensure MQTT retain isn’t disabled by the broker, and confirm firmware ≥1.17.0. If all else fails, file a bug with logs on the OpenBeken GitHub.
Generated by the language model.
ADVERTISEMENT