Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam2024-05-27 11:31:10.133 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on GarageLicht/connected (qos=1): b'offline'
2024-05-27 11:31:10.146 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: register write 45
2024-05-27 11:31:10.157 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: unregister write 45
2024-05-27 11:31:10.243 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on GarageLicht/connected (qos=1): b'online'
2024-05-27 11:31:10.249 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: register write 45
2024-05-27 11:31:10.258 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: unregister write 45
2024-05-27 11:31:10.269 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on GarageLicht/0/get (qos=1): b'1'
2024-05-27 11:31:10.274 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: register write 45
2024-05-27 11:31:10.279 DEBUG (MainThread) [homeassistant.components.mqtt.client] Transmitting message on GarageLicht/0/set: '1', mid: 537, qos: 1
2024-05-27 11:31:10.285 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.0.122: unregister write 45TL;DR: If your OpenBK switch turns on around 03:00 and logs show "HA sends value 1", the usual cause is Home Assistant MQTT behavior after reconnect, not a spontaneous OpenBK relay change. This FAQ helps Home Assistant, Mosquitto, and OpenBK users stop night-time self-activation by checking uptime, MQTT topics, and discovery settings. [#20939162]
Why it matters: A relay that flips ON at 03:00 can light rooms, trigger gates, or create unsafe automations after Wi‑Fi or broker reconnects.
| Setup choice | What the thread showed | Result |
|---|---|---|
Manual configuration.yaml MQTT setup |
Some devices received .../0/set 1 after reconnect |
Unwanted turn-ons persisted |
| Home Assistant auto-discovery | Problem disappeared after removing manual YAML entries | Stable behavior reported |
| MQTT reconnect without cleanup | Devices went unavailable, then reconnected within seconds | Some relays turned ON |
Key insight: The strongest evidence in the thread is the OpenBK log line showing MQTT received data
1on the command topic right after reconnect. That points to Home Assistant or retained MQTT state, not random firmware self-activation.
1 on topic Interruptor barra/0/set, changed channel 0 to 1, then later published 0 again; that shows an external command path, not a local spontaneous toggle. [#20939156]configuration.yaml entries fixed the unwanted activations. [#21112094]data is 1 for ch 0, then CHANNEL_Set channel 0 has changed to 1. The thread also shows many devices going unavailable between 03:00 and 04:00, then reconnecting seconds later, which matches a broker, router, or HA event window. [#20939156]Online for 16 hours, 38 minutes, and 8 seconds, the device did not reboot at 03:00 that night. That distinction matters because a reconnect without reboot points to MQTT, Home Assistant, or network interruptions instead of a firmware crash or power cycle. [#20899305]1 right after reconnect because it restores or republishes state through the MQTT command topic when the device comes back online. The OpenBK log in this case shows mqtt_incoming_publish_cb topic Interruptor barra/0/set, then data is 1 for ch 0, then channel 0 changes to 1. The thread’s expert conclusion was direct: “your HA sends value 1 to OBK just when OBK connects.” [#20939162]configuration.yaml definitions. If the relay still activates, test with MQTT disabled for one night, then inspect whether .../0/set 1 appears after reconnect. [#21112094]Flag 21 - [MQTT] Retain power channels as a workaround, and also testing retain: true in Home Assistant. It can help state recovery, but users reported it did not fix every device. [#20939306]configuration.yaml setups were repeatedly linked with reconnect events that sent .../0/set 1, while the original poster later said the problem disappeared after enabling Home Assistant detection and removing manual YAML entries. That makes discovery the safer choice here for avoiding false ON commands after MQTT reconnects. [#21203425]configuration.yaml. 3. Restart the device and verify Home Assistant recreates it through discovery. The thread’s confirmed fix was exactly that sequence: enable auto-detection, eliminate manual YAML, and the unwanted turn-ons stopped. [#21112094]1 to the command topic. So the startup setting may be correct, yet the relay still turns ON because an external MQTT command overrides it moments later. [#20939156]mqtt_incoming_publish_cb topic Interruptor barra/0/set, then mqtt_incoming_data_cb data is 1 for ch 0, and only after that CHANNEL_Set channel 0 has changed to 1. That sequence proves the relay changed because MQTT sent a command, not because the relay logic toggled locally. [#20939156]1 to a relay command topic. [#21092693]