Skip to content

Commit

Permalink
Update debug (#2675)
Browse files Browse the repository at this point in the history
* Update debug

* update
  • Loading branch information
Koenkk authored Apr 3, 2024
1 parent 0e899e6 commit fb543b5
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions docs/guide/usage/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,17 @@ sidebarDepth: 1
In case Zigbee2MQTT isn't working as expected the following tips can help you in finding the problem.

## Enabling logging

### Zigbee2MQTT debug logging
To enable debug logging for Zigbee2MQTT add the following in your `configuration.yaml`
To enable debug logging, add the following in your `configuration.yaml`

```yaml
advanced:
log_level: debug
```
### Zigbee-herdsman debug logging
To enable debug logging for Zigbee-herdman start Zigbee2MQTT with: `DEBUG=zigbee-herdsman* npm start`. Zigbee-herdsman is the Zigbee library where Zigbee2MQTT is based up-on.

**Important:** this is **not** logged to the log files and is only available on the STDOUT/STDERR.

To enable debug logging in the Zigbee2MQTT Docker container add `-e DEBUG=zigbee-herdsman*` to your `docker run` command. The logging can be retrieved via `docker logs ZIGBEE2MQTT_CONTAINER_NAME > log.txt 2>&1`.

### Home Assistant OS/Supervised addon
- Go to `Supervisor` in the main menu and click on the `Zigbee2MQTT` addon or follow this deep [link](https://my.home-assistant.io/redirect/supervisor_addon/?addon=45df7312_zigbee2mqtt&repository_url=https%3A%2F%2Fgithub.com%2Fzigbee2mqtt%2Fhassio-zigbee2mqtt)
- In the top tabs, click on `Configuration`
- Toggle the option: `Show unused optional configuration options`
- Toggle the option: `zigbee_herdsman_debug`
- Click `Save`, and when prompted to restart, click `Restart add-on`

Herdsman debug logs should now show up on the `Logs` tab for the addon.

To grab all the logs, log in via SSH and execute:

```
docker logs CONTAINER_ID > log.txt 2>&1
```

To determine the `CONTAINER_ID` execute `docker ps`.
In the logging you will see the following abbreviations:
- `z2m`: Zigbee2MQTT
- `zh`: [zigbee-herdsman](https://github.com/koenkk/zigbee-herdsman), logged events from the Zigbee library used by Zigbee2MQTT.
- `zhc`: [zigbee-herdsman-converters](https://github.com/koenkk/zigbee-herdsman-converters), logged events from the devices support library.

## Change log level during runtime
See [MQTT topics and message structure](./mqtt_topics_and_messages.md)

0 comments on commit fb543b5

Please sign in to comment.