野生程序员
发布于 2023-11-05 / 132 阅读 / 0 评论 / 0 点赞

haos 执行docker

安装 Advanced SSH & Web Terminal

username: hassio
password: "1234"
authorized_keys: []
sftp: false
compatibility_mode: false
allow_agent_forwarding: false
allow_remote_port_forwarding: false
allow_tcp_forwarding: false

登录

http://192.168.1.13:7681/
输入 登录 root
login


搜索文件

find / -name automations.yaml

haos 所在目录

/mnt/data/supervisor/homeassistant/automations.yaml

拉取镜像

docker pull koenkk/zigbee2mqtt:1.33.1

运行

docker run -itd --name="zigbee2mqtt_1" -p 8081:8080 -e TZ=Aisa/Shanghai --restart=always -v /mnt/data/supervisor/homeassistant/zigbee2mqtt_1/data:/app/data koenkk/zigbee2mqtt:1.33.1

访问 ip:8081 能添加设备

导出镜像到本地

docker save > /mnt/data/supervisor/homeassistant/镜像/zigbee2mqtt:1.33.1.tar koenkk/zigbee2mqtt:1.33.1

导入镜像到docker

docker load < /www/wwwroot/docker/ha/镜像/zigbee2mqtt:1.33.1.tar

进入容器

会在配置目录生成下面配置

/mnt/data/supervisor/homeassistant/zigbee2mqtt_1/data
homeassistant: false
frontend: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
serial:
  port: /dev/ttyACM0
advanced:
  network_key:
    - 210
    - 133
    - 66
    - 220
    - 58
    - 98
    - 110
    - 36
    - 78
    - 155
    - 206
    - 162
    - 169
    - 43
    - 22
    - 78
  pan_id: 56286
  ext_pan_id:
    - 12
    - 81
    - 212
    - 17
    - 127
    - 149
    - 171
    - 92

修改一些配置

homeassistant: true
frontend: true
mqtt:
  base_topic: zigbee2mqtt_1
  server: mqtt://192.168.1.13:1883
  user: mqtt
  password: mqtt
serial:
  adapter: zstack
  port: tcp://192.168.1.20:6638
advanced:
  channel: 11

设置mqtt账号密码

- username: mqtt
  password: mqtt


评论