Advertisement
Guest User

Untitled

a guest
Jan 4th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #This assumes you have docker installed
  2. #It also assumes you have docker-compose installed, if you don't then follow these instructions: https://withblue.ink/2017/12/31/yes-you-can-run-docker-on-raspbian.html
  3.  
  4. #create your docker folder
  5. sudo mkdir /docker
  6.  
  7. #set the ownership of the folder to the pi user
  8. sudo chmod pi:pi /docker
  9.  
  10. #create a zigbee2mqtt folder
  11. mkdir /docker/zigbee2mqtt
  12.  
  13. #plug in your zigbee usb device and find the serial of the device:
  14. ls /dev/serial/by-id/
  15. #it probably looks something like this: usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D9E26D-if00
  16.  
  17. #Go to your new directory
  18. cd /docker/zigbee2mqtt
  19.  
  20. #create a docker-compose file for zigbee2mqtt
  21. nano docker-compose.yaml
  22.  
  23. #paste the following configuration and add your own zigbee usb device serial under devices between by-id and :/dev/ttyACM0:rwm
  24. version: '2.1'
  25. services:
  26. zigbee2mqtt:
  27. container_name: zigbee2mqtt
  28. image: koenkk/zigbee2mqtt:arm32v6
  29. volumes:
  30. - /docker/zigbee2mqtt/data:/app/data
  31. devices:
  32. - /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D9E26D-if00:/dev/ttyACM0:rwm
  33. restart: always
  34.  
  35. #save the file (ctrl + x then y)
  36. #pull the image
  37. docker-compose pull
  38.  
  39. #create and startup the container
  40. docker-compose up -d
  41.  
  42. #give it a minute or two then shutdown the container
  43. docker-compose stop
  44.  
  45. #there should now be a data folder with a configuration.yaml file inside
  46. ls -al
  47.  
  48. #edit the configuration.yaml
  49. nano data/configuration.yaml
  50.  
  51. #replace the contents with this:
  52. homeassistant: true
  53. permit_join: true
  54. mqtt:
  55. base_topic: zigbee2mqtt
  56. server: 'mqtt://127.0.0.1' #assuming hassio is on the same RPI
  57. user: homeassistant #set your hassio username
  58. password: yourpassword #set your hassio password
  59. serial:
  60. port: /dev/ttyACM0
  61.  
  62. #this will setup zigbee2mqtt correctly (the hassio part isn't quite done yet)
  63. #start zigbee2mqtt again and try and pair some zigbee devices to it.
  64. docker-compose start
  65.  
  66. #you can confirm devices have joined by either looking at or watching the log files
  67. cat data/log/[DATE]/log.txt
  68. #or
  69. tail -f data/log/[date]/log.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement