Skip to content

Commit

Permalink
Support watchdog Koenkk/zigbee2mqtt#23148
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 27, 2024
1 parent c726c16 commit 120082a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions common/rootfs/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ advanced:
EOF
fi

if bashio::config.has_value 'watchdog'; then
export Z2M_WATCHDOG="$(bashio::config 'watchdog')"
bashio::log.info "Enabled Zigbee2MQTT watchdog with value '$Z2M_WATCHDOG'"
fi

export NODE_PATH=/app/node_modules
export ZIGBEE2MQTT_CONFIG_FRONTEND='{"port": 8099}'

Expand Down
3 changes: 2 additions & 1 deletion zigbee2mqtt-edge/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"adapter": "match(zstack|deconz|zigate|ezsp|ember)?",
"baudrate": "int?",
"rtscts": "bool?"
}
},
"watchdog": "str?"
},
"image": "zigbee2mqtt/zigbee2mqtt-edge-{arch}"
}
9 changes: 9 additions & 0 deletions zigbee2mqtt/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ Configuration required to startup Zigbee2MQTT is available from the addon config
The add-on will create a backup of your configuration.yml within your data path: `$DATA_PATH/configuration.yaml.bk`. When upgrading, you should use this to fill in the relevant values into your new config, particularly the network key, to avoid breaking your network and having to repair all of your devices.
The backup of your configuration is created on add-on startup if no previous backup was found.

# Enabling the watchdog
To automatically restart Zigbee2MQTT in case of a crash, the watchdog can be used. It can be enabled by adding the following to the addon configuration:

This comment has been minimized.

Copy link
@Nerivec

Nerivec Jun 27, 2024

Probably should change the wording here. Crash is to wide a scope.
I used soft failures in rest of the docs (for lack of a better idea 😅).

Zigbee2MQTT supports a simple watchdog for "soft failures" (failures that Zigbee2MQTT can handle properly without crashing, like "adapter disconnected").

This comment has been minimized.

Copy link
@Koenkk

Koenkk Jun 28, 2024

Author Contributor

Updated!


```yaml
watchdog: default
```
This will use the default watchdog retry delays of 1min, 5min, 15min, 30min, 60min. Custom delays are also supported, e.g. `watchdog: 5,10,30` will start Zigbee2MQTT with the watchdog's retry delays of 5min, 10min, 30min. For more information about the watchdog, read the [docs](https://www.zigbee2mqtt.io/guide/installation/15_watchdog.html).

# Adding Support for New Devices
If you are interested in adding support for new devices to Zigbee2MQTT see [How to support new devices](https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html).

Expand Down
3 changes: 2 additions & 1 deletion zigbee2mqtt/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"adapter": "match(zstack|deconz|zigate|ezsp|ember)?",
"baudrate": "int?",
"rtscts": "bool?"
}
},
"watchdog": "str?"
},
"image": "zigbee2mqtt/zigbee2mqtt-{arch}"
}

0 comments on commit 120082a

Please sign in to comment.