Publish bridge/state online when Home Assistant comes online. https://github.com/Koenkk/zigbee2mqtt/issues/9629

This commit is contained in:
Koen Kanters
2022-01-16 14:56:58 +01:00
parent d6ee1a6450
commit b6a7ade6f2
+1
View File
@@ -1271,6 +1271,7 @@ export default class HomeAssistant extends Extension {
data.message.toLowerCase() === 'online') {
const timer = setTimeout(async () => {
// Publish all device states.
this.mqtt.publish('bridge/state', 'online', {retain: true, qos: 0});
for (const device of this.zigbee.devices(false)) {
if (this.state.exists(device)) {
this.publishEntityState(device, this.state.get(device));