Last active
January 5, 2024 17:38
-
-
Save EpicLPer/84172ee9ee5ce47e70de52ad28c4ff13 to your computer and use it in GitHub Desktop.
Revisions
-
EpicLPer revised this gist
Jan 5, 2024 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,11 @@ I've created a small automation which automatically restarts the Z2M addon in or _**As a note:**_ This is of course not a "fix". The real fix is to get better hardware/fix the crashing stick issue. This is more a workaround to get things rolling without a huge downtime! ```yaml # ----------------------------------------------------------- # --- You might have to set Zigbee2MQTT to "debug" output --- # --- in "Settings" > "Advanced" > "Log level"! --- # ----------------------------------------------------------- alias: AUTO - Zigbee2MQTT Restart upon adapter crash description: Automatically restarts the Z2M addon when an adapter crash has been detected. trigger: -
EpicLPer created this gist
Jan 5, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ I'm using both Home Assistant and Zigbee2MQTT as my main Smarthome drivers, however I'm having a bit of an issue with my Sonoff Zigbee-P Dongle where it tends to crash randomly, often at night, leaving people in the house without any lights responding. I've created a small automation which automatically restarts the Z2M addon in order to reconnect to the stick. Hope it helps! _**As a note:**_ This is of course not a "fix". The real fix is to get better hardware/fix the crashing stick issue. This is more a workaround to get things rolling without a huge downtime! ```yaml alias: AUTO - Zigbee2MQTT Restart upon adapter crash description: Automatically restarts the Z2M addon when an adapter crash has been detected. trigger: - platform: mqtt topic: zigbee2mqtt/bridge/logging payload: "on" # --- These are the most common error messages upon the stick crashing/disconnecting. value_template: > {% if ('SRSP - AF - dataRequestExt after 6000ms' in value_json['message']) %} on {% elif ('SRSP - AF - dataRequest after 6000ms' in value_json['message']) %} on {% elif ('SRSP - ZDO - mgmtPermitJoinReq after 6000ms' in value_json['message']) %} on {% else %} off {% endif %} id: error-occured alias: When MQTT log output via Z2M throws error messages condition: [] action: - alias: When ID "error-occured" is received if: - condition: trigger id: - error-occured alias: "Trigger: \"error-occured\"" then: # --- Add your own mobile app here if you want! Or, if you don't want to be notified simply just remove it in the GUI. - service: notify.mobile_app_XXXXX data: message: Restarting Z2M... title: ⚠️ Zigbee Adapter crashed! ⚠️ alias: "Service Call: Mobile App Notification" - service: hassio.addon_restart data: # --- You have to edit this (can also be done in th GUI) as the value in front will be different for you! addon: XXXXX_zigbee2mqtt alias: "Service Call: Restart Add-On (Zigbee2MQTT)" mode: single ```