logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

OpenBeken Devices Displaying Multiple Switch Toggle Icons upon Home Assistant Restart

DCG 2307 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: 14622
    Help: 655
    Rate: 12638
    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.
  • #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: 604
    Help: 34
    Rate: 129

    >>20733563

    Confirmed, but to be honest, I thought it was a HA issue, so I didn't look into it more.
  • #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: 604
    Help: 34
    Rate: 129
    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)
  • ADVERTISEMENT
  • #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.
  • ADVERTISEMENT
  • #10 20734447
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    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.
  • ADVERTISEMENT
  • #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.
  • #13 20734882
    DeDaMrAz
    Level 22  
    Posts: 604
    Help: 34
    Rate: 129

    @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: 14622
    Help: 655
    Rate: 12638
    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: 14622
    Help: 655
    Rate: 12638
    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: 14622
    Help: 655
    Rate: 12638
    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: 14622
    Help: 655
    Rate: 12638
    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: 14622
    Help: 655
    Rate: 12638
    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: If Home Assistant restart makes OpenBeken show 2 toggle icons or an unknown state, this FAQ is for you. One user saw it from day 1 after moving to OpenBeken, and another confirmed: "enabling Flag 2 helped." The most reliable Home Assistant-side fix in the thread is sending publishAll on HA start so devices republish their MQTT state automatically. [#20762085]

Why it matters: This issue does not usually break switching, but it makes Home Assistant show the wrong control state until a manual toggle or forced republish corrects it.

Approach Reported result Speed after HA reboot Notes
Enable Flag 2 Helped Slower than Tasmota Confirmed workaround by multiple users
publishAll on HA start Worked perfectly Better than polling every 60 s Best HA-side workaround reported
Flag 10 only Did not fix it for one user N/A Default on affected devices
Flag 7 Solved a similar unknown-state issue N/A Reported as an alternative for dimmers

Key insight: The thread points to a state-republish timing problem after Home Assistant boots, not a broken relay. For most users here, forcing OpenBeken devices to republish MQTT state on startup fixed the duplicate-toggle symptom.

Quick Facts

  • The original reporter had the problem from the beginning, within 10 days of moving to OpenBeken, and only after a Home Assistant restart. [#20733572]
  • Affected hardware skewed toward OpenBeken power switches; one user rechecked after a reboot and found Zigbee devices and OpenBeken lights were normal, while OBK power switches still misbehaved. [#20734615]
  • One affected setup included a 4-gang switch with Flags 10 and 37 enabled; other bulbs had Flags 08, 10, 12, 18, and 37, yet the issue stayed the same. [#20735240]
  • The maintainer suggested an autoexec.bat sequence that waits for MQTT connection, adds a 1 s delay, then runs publishChannels. [#20743863]
  • A user preferred publishAll on HA startup over periodic MQTT traffic, saying it worked better than sending messages every 60 s. [#20761607]

Why do OpenBeken power switches show multiple toggle icons or an unknown state in Home Assistant after a restart?

They show duplicate toggles or unknown because Home Assistant starts before the affected OpenBeken devices republish a clean MQTT state. In the thread, the issue appeared only after HA reboot and cleared as soon as the user toggled the entity once. Another user rechecked and found the behavior on OBK power switches, not on Zigbee devices or OBK lights, which points to state recovery timing rather than relay failure. [#20734615]

How can I fix the duplicate switch toggle icons that appear for OpenBeken devices when Home Assistant reboots?

The most effective fix reported was a Home Assistant automation that sends publishAll to all OpenBeken devices when HA starts. One user said this script-and-automation method “worked perfectly.” Enabling Flag 2 also helped as a workaround, but the response after reboot stayed slower than with Tasmota. [#20762085]

What is the best workaround in Home Assistant to restore correct OpenBeken switch states automatically after startup?

Use an HA startup automation that publishes cmnd/bekens/publishAll once Home Assistant boots. A user tested that approach on October 7, 2023 and reported that it restored states correctly without needing manual toggles. It also avoided sending MQTT refresh messages every 60 s. [#20761607]

How do I create a Home Assistant automation that sends MQTT publishAll or publishChannels to OpenBeken devices on HA start?

Create a startup automation and call MQTT publish or a script. 1. Make a script that publishes to cmnd/bekens/publishAll with an empty payload. 2. Set all OpenBeken devices to the same Group Topic, such as bekens. 3. Trigger that script on the Home Assistant start event. The same idea can also use publishChannels instead of publishAll. [#20761607]

What does OpenBeken Flag 2 do, and why does enabling it help with wrong or delayed switch states after Home Assistant restarts?

In this thread, Flag 2 acted as a practical workaround because it made affected devices recover their visible state after HA restarted. One user explicitly said enabling Flag 2 solved the problem “for now,” while another confirmed it helped but still felt slower than Tasmota after reboot. That makes Flag 2 useful when you want a device-side fix before adding HA automation. [#20743791]

What is the OpenBeken publishAll or publishChannels command, and when should it be used with MQTT discovery in Home Assistant?

"publishAll" is an OpenBeken MQTT command that republishes all relevant device values, forcing Home Assistant to refresh entities after startup or reconnect. Its key characteristic is broad state refresh across devices that share one Group Topic, which makes it useful when discovery entities come back as duplicated or unknown. Use it right after HA start or MQTT reconnect. [#20761607]

How does OpenBeken state reporting after Home Assistant boot compare with Tasmota for MQTT devices?

In this discussion, Tasmota was described as faster after Home Assistant boot. One user said Tasmota devices showed state “within seconds,” while the OpenBeken workaround with Flag 2 fixed the display issue but still responded more slowly after restart. Another user said publishAll was good, but still not as fast as Tasmota integration. [#20761607]

Why do OpenBeken power switches seem affected by this issue while some OpenBeken lights or devices changed from Switch to Light in Home Assistant do not?

The thread suggests the problem is tied to how Home Assistant restores certain switch entities, especially power switches, not every OpenBeken device type. One user found OBK lights were fine while OBK power switches were not. The original reporter also said the issue did not occur on devices changed from Switch to Light using the HA Helper option. [#20734615]

Which OpenBeken flags were reported on affected devices, and how can flags like 2, 7, 10, or 37 influence HA state behavior?

Affected devices were reported with Flags 10 and 37 on a 4-gang switch, and Flags 08, 10, 12, 18, and 37 on bulbs. Flag 10 alone did not solve the issue for that user, even though it was enabled by default. Flag 2 helped as a workaround, and Flag 7 later solved a similar unknown-state problem by retaining published MQTT values. [#20815209]

How do I test whether the problem is caused by Home Assistant MQTT discovery or by manual YAML configuration for OpenBeken devices?

Add one affected OpenBeken device through manual MQTT YAML and then reboot Home Assistant. In the thread, the maintainer proposed that exact test first. The reporter tried it, and the problem still remained, which showed the symptom was not limited to discovery-generated entities. [#20736156]

What manual MQTT YAML configuration should I use for an OpenBeken light in Home Assistant, and what parts of the config matter for state recovery after reboot?

Use a standard MQTT light config with command_topic, state_topic, availability_topic, and matching RGB, brightness, and color temperature topics. The posted example used wall_bulb/connected for availability and wall_bulb/led_enableAll/get for state. The maintainer reviewed that YAML and said, “This is correct,” so the config structure itself was not the root cause. [#20736712]

Why do OpenBeken devices return to a normal single toggle after I click one of the duplicated controls in Home Assistant?

They return to one toggle because your click forces a fresh MQTT state update, which makes Home Assistant redraw the entity correctly. Multiple users observed the same pattern: the duplicate control appeared only after HA reboot and disappeared after toggling from Home Assistant. That behavior fits a stale-state display issue, not a permanent entity duplication. [#20734156]

What does 'broadcast self state on connect' mean in OpenBeken, and how is it different from forcing a publishAll after MQTT reconnect?

"Broadcast self state on connect" is an OpenBeken behavior that sends a device’s own current state when it reconnects to MQTT, without needing a central Home Assistant command. Its key characteristic is automatic device-side publishing at connect time, while publishAll is a forced broker command that tells devices to republish everything. In the thread, Flag 10 matched the first approach, but it did not solve the issue for one user. [#20743855]

How can I use autoexec.bat in OpenBeken to wait for MQTT connection and then publishChannels automatically?

Use an autoexec.bat startup sequence that waits for MQTT, pauses briefly, then republishes channels. 1. Add waitFor MQTTState 1. 2. Add delay_s 1. 3. Add publishChannels. The maintainer proposed this exact 3-line sequence as an alternative to using Flag 2, so it is a device-side startup fix rather than an HA automation. [#20743863]

What alternative fix can I try if Flag 2 does not solve the OpenBeken unknown-state issue, such as retained MQTT messages with Flag 7?

Enable Flag 7 and test again after a full HA restart. One user reported a similar issue on OBK light dimmer relays and solved it by enabling Flag 7, described as “Always set Retain flag to all published values.” That fix targets retained MQTT state, so it is a sensible fallback if Flag 2 or publishAll still leaves entities as unknown. [#20815209]
Generated by the language model.
ADVERTISEMENT