diff --git a/common/rootfs/docker-entrypoint.sh b/common/rootfs/docker-entrypoint.sh index 05b82bca1..7237b2070 100755 --- a/common/rootfs/docker-entrypoint.sh +++ b/common/rootfs/docker-entrypoint.sh @@ -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}' diff --git a/zigbee2mqtt-edge/config.json b/zigbee2mqtt-edge/config.json index d7050dffa..323a08880 100644 --- a/zigbee2mqtt-edge/config.json +++ b/zigbee2mqtt-edge/config.json @@ -68,7 +68,8 @@ "adapter": "match(zstack|deconz|zigate|ezsp|ember)?", "baudrate": "int?", "rtscts": "bool?" - } + }, + "watchdog": "str?" }, "image": "zigbee2mqtt/zigbee2mqtt-edge-{arch}" } diff --git a/zigbee2mqtt/DOCS.md b/zigbee2mqtt/DOCS.md index 894473b7a..77823fec0 100644 --- a/zigbee2mqtt/DOCS.md +++ b/zigbee2mqtt/DOCS.md @@ -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: + +```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). diff --git a/zigbee2mqtt/config.json b/zigbee2mqtt/config.json index b891fb9f4..bbe5c50eb 100644 --- a/zigbee2mqtt/config.json +++ b/zigbee2mqtt/config.json @@ -68,7 +68,8 @@ "adapter": "match(zstack|deconz|zigate|ezsp|ember)?", "baudrate": "int?", "rtscts": "bool?" - } + }, + "watchdog": "str?" }, "image": "zigbee2mqtt/zigbee2mqtt-{arch}" }