Come visualizzare una mappa dei dispositivi su zigbee2mqtt

C’è un bel progetto su GitHub che vi permette di visualizzare tutti i dispositivi connessi alla vostra rete ZigBee: https://github.com/rgruebel/ha_zigbee2mqtt_networkmap

Prima di tutto dovete copiarlo nella vostra directory di Home Assistant e aggiungere alla configurazione:

 webhook:
 
 zigbee2mqtt_networkmap:
 panel_iframe:
   networkmap:
     title: 'Zigbee Map'
     url: '/local/community/zigbee2mqtt_networkmap/map.html'
     icon: 'mdi:graphql'
Screenshot di Home Assistant

Come connettere un nuovo dispositivo con zigbee2mqtt

Dovrete prima di tutto stoppare il container con:

sudo docker stop zigbee2mqtt

Poi modificate il file di configurazione:

sudo nano ~/zigbee2mqtt/data/configuration.yaml

E modificare la riga in:

permit_join: true
Screenshot di zigbee2mqtt.io

Per permettere l’aggiunta di nuovi dispositivi.
Poi riavviate il container con sudo docker start zigbee2mqtt e attivate l’abbinamento sul dispositivo (ogni dispositivo ha un metodo diverso di abbinamento https://www.zigbee2mqtt.io/information/supported_devices.html).

Nei log dovreste vedere qualcosa di questo genere:

  zigbee2mqtt:info 2019-1-1 19:43:06 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:06 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:06 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:06 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:06 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:06 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:06 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:06 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:06 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:06 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:06 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:07 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:07 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:07 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:07 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:07 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:07 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:07 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:07 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:07 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:07 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:07 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:07 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:07 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:07 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:07 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:07 Message without device!
  zigbee2mqtt:debug 2019-1-1 19:43:07 Received zigbee message of type 'devInterview' with data '"0x0123456789"'
  zigbee2mqtt:info 2019-1-1 19:43:07 Connecting with device...
  zigbee2mqtt:info 2019-1-1 19:43:07 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}'
  zigbee2mqtt:warn 2019-1-1 19:43:07 Message without device!

Questo vuol dire che avete correttamente abbinato un nuovo dispositivo!
Mi raccomando disabilitate poi il permit_join con un false.

Come aggiornare zigbee2mqtt con Docker

Se avete installato zigbee2mqtt come vi avevo indicato qui, per aggiornarlo, con Docker, vi basterà eseguire questi semplici comandi:

sudo docker rm -f zigbee2mqtt
sudo docker rmi -f koenkk/zigbee2mqtt:latest
cd /home/pi/zigbee2mqtt
sudo docker run \\
   -it \\
   -v $(pwd)/data:/app/data \\
   --device=/dev/ttyACM0 \\
   koenkk/zigbee2mqtt

Ora vedete se tutto funziona e nel caso create un container:

sudo docker create --name=zigbee2mqtt \\
   --restart=always \\
   -it \\
   -v $(pwd)/data:/app/data \\
   --device=/dev/ttyACM0 \\
   koenkk/zigbee2mqtt

E fatelo ripartire:

sudo docker start zigbee2mqtt