Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lesson16 - integrate ZigBee device to home assistant by Zigbee2MQTT
#1

1. Add the repository URL under Supervisor->Add-on store->...->Manage add-on repositories:

https://github.com/zigbee2mqtt/hassio-zigbee2mqtt

2. Zigbee2mqtt add-on Configuration for home assistant

data_path: /config/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.96:1883
  user: mqtt
  password: '123'
serial:
  port: /dev/ttyACM0
advanced:
  log_level: info
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: '-d -d'

3. feedback click action mqtt message:

  1: single
  2: double
  3: triple
  4: quadruple
  5: many

4. Xiaomi zigbee switch configure for home assistant by Zigbee2mqtt

sensor:
  - platform: mqtt
    name: Voltage
    state_topic: "zigbee2mqtt/0x00158d00067ec29e"
    value_template: "{{ value_json.battery }}"
    unit_of_measurement: "%"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"
    qos: 0
    device_class: battery

  - platform: mqtt
    name: signal
    state_topic: "zigbee2mqtt/0x00158d00067ec29e"
    value_template: "{{ value_json.linkquality }}"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"
    qos: 0
    device_class: signal_strength

  - platform: mqtt
    name: click
    state_topic: "zigbee2mqtt/0x00158d00067ec29e"
    value_template: "{{ value_json.click }}"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"

Note: ID need replace with your device. such as '0x00158d00067ec29e'

5. create a new automation:

Trigger type: State
Entity: sensor.click
To: single


Actions:
Action type: Call service
Service: Switch:Toggle
+ Pick entity
Reply
#2
Hello

I receive an error at step of zigbee start.

I have rechecked the configuration, mqtt server/user/pass, activation of usb. The donglle has a green flash when I connect to usb for a few seconds and then remains green continously on for almost a minute .


[17:41:13] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.25.2 start
> node index.js
Zigbee2MQTT:info 2022-06-16 17:41:19: Logging to console and directory: '/config/zigbee2mqtt/log/2022-06-16.17-41-19' filename: log.txt
Zigbee2MQTT:info 2022-06-16 17:41:19: Starting Zigbee2MQTT version 1.25.2 (commit #unknown)
Zigbee2MQTT:info 2022-06-16 17:41:19: Starting zigbee-herdsman (0.14.34)
Zigbee2MQTT:error 2022-06-16 17:41:20: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-06-16 17:41:20: Failed to start zigbee
Zigbee2MQTT:error 2022-06-16 17:41:20: Check https://www.zigbee2mqtt.io/guide/install...start.html for possible solutions
Zigbee2MQTT:error 2022-06-16 17:41:20: Exiting...
Zigbee2MQTT:error 2022-06-16 17:41:20: Error: spawn udevadm ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Reply
#3
I reinstalled the add-on and it worked
Reply
#4
ok
Reply
#5
Hi!
Trying to use Kincony Zigbee Adapter but it's not being recognized by HA. I don't see it in dmesg or ha hardware info. When trying to starte zigbee2mqtt because port doesn't exist. Any ideas?
Reply
#6
if you are the first time use CM4, you need to enable USB port , here is details how to do: https://www.kincony.com/forum/showthread.php?tid=1980
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)