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]
Which devices are affected?
Reports show OBK power switches misbehave, while OBK lights and Zigbee gear stay normal [Elektroda, MnM1, post #20734615]
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?
- Open the device’s web UI.
- Go to Settings → Flags.
- 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.