Better remove it again from your configuration.yaml, it looks like a mess like that.
in /config , create a directory packages
in your configuration.yaml, add a line under homeassistant, so it looks like this :
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: -28.389010
longitude: 153.564590
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Australia/Sydney
# Customization file
customize: !include customize.yaml
packages: !include_dir_named packages
Then, in/config/packages packages, create a file zigbee2mqtt.yaml, and add the following :
# Input select for Zigbee2mqtt debug level
input_select:
zigbee2mqtt_log_level:
name: Zigbee2mqtt Log Level
options:
- debug
- info
- warn
- error
initial: info
icon: mdi:format-list-bulleted
# Input text to input Zigbee2mqtt friendly_name for scripts
input_text:
zigbee2mqtt_old_name:
name: Zigbee2mqtt Old Name
zigbee2mqtt_new_name:
name: Zigbee2mqtt New Name
zigbee2mqtt_remove:
name: Zigbee2mqtt Remove
# Scripts for renaming & removing devices
script:
zigbee2mqtt_rename:
alias: Zigbee2mqtt Rename
sequence:
service: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/config/rename
payload_template: >-
{
"old": "{{ states.input_text.zigbee2mqtt_old_name.state | string }}",
"new": "{{ states.input_text.zigbee2mqtt_new_name.state | string }}"
}
zigbee2mqtt_remove:
alias: Zigbee2mqtt Remove
sequence:
service: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/config/remove
payload_template: "{{ states.input_text.zigbee2mqtt_remove.state | string }}"
# Timer for joining time remaining (120 sec = 2 min)
timer:
zigbee_permit_join:
name: Time remaining
duration: 120
sensor:
# Sensor for monitoring the bridge state
- platform: mqtt
name: Zigbee2mqtt Bridge state
state_topic: "zigbee2mqtt/bridge/state"
icon: mdi:router-wireless
# Sensor for Showing the Zigbee2mqtt Version
- platform: mqtt
name: Zigbee2mqtt Version
state_topic: "zigbee2mqtt/bridge/config"
value_template: "{{ value_json.version }}"
icon: mdi:zigbee
# Sensor for Showing the Coordinator Version
- platform: mqtt
name: Coordinator Version
state_topic: "zigbee2mqtt/bridge/config"
value_template: "{{ value_json.coordinator }}"
icon: mdi:chip
- platform: mqtt
name: ZigBee Log Level
state_topic: "zigbee2mqtt/bridge/config"
value_template: "{{ value_json.log_level }}"
- platform: mqtt
name: ZigBee Permit Join
state_topic: "zigbee2mqtt/bridge/config"
value_template: "{{ value_json.permit_join }}"
icon: mdi:location-enter
# Switch for enabling joining
switch:
- platform: mqtt
name: "Zigbee2mqtt Main join"
state_topic: "zigbee2mqtt/bridge/config/permit_join"
command_topic: "zigbee2mqtt/bridge/config/permit_join"
payload_on: "true"
payload_off: "false"
automation:
# Automation for sending MQTT message on input select change
- alias: Zigbee2mqtt Log Level
initial_state: "on"
trigger:
platform: state
entity_id: input_select.zigbee2mqtt_log_level
action:
- service: mqtt.publish
data:
payload_template: "{{ states('input_select.zigbee2mqtt_log_level') }}"
topic: zigbee2mqtt/bridge/config/log_level
# Automation for sending MQTT message on input select change
- id: '1595654450786'
alias: Sync Zigbee log level input_select
description: Sync Zigbee log level input_select
mode: single
trigger:
- entity_id: sensor.zigbee_log_level
platform: state
condition: []
action:
- service: automation.turn_off
entity_id: automation.zigbee2mqtt_log_level
- service: input_select.select_option
data_template:
option: '{{states("sensor.zigbee_log_level")}}'
entity_id: input_select.zigbee2mqtt_log_level
- service: automation.turn_on
entity_id: automation.zigbee2mqtt_log_level
# Automation to start timer when enable join is turned on
- id: zigbee_join_enabled
alias: Zigbee Join Enabled
trigger:
platform: state
entity_id: switch.zigbee2mqtt_main_join
to: "on"
action:
service: timer.start
entity_id: timer.zigbee_permit_join
# Automation to stop timer when switch turned off and turn off switch when timer finished
- id: zigbee_join_disabled
alias: Zigbee Join Disabled
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.zigbee_permit_join
- platform: state
entity_id: switch.zigbee2mqtt_main_join
to: "off"
action:
- service: timer.cancel
data:
entity_id: timer.zigbee_permit_join
- service: switch.turn_off
entity_id: switch.zigbee2mqtt_main_join
Now, in lovelace, choose configure ui
Again, choose raw configuration editor
and paste the following :
- entities:
- input_select.zigbee2mqtt_log_level
title: Input select
type: entities
- entities:
- input_text.zigbee2mqtt_old_name
- input_text.zigbee2mqtt_new_name
- input_text.zigbee2mqtt_remove
title: Input text
type: entities
- entities:
- script.zigbee2mqtt_rename
- script.zigbee2mqtt_remove
title: Script
type: entities
- entities:
- entity: sensor.zigbee2mqtt_version
- entity: sensor.zigbee2mqtt_bridge_state
- entity: binary_sensor.zigbee2mqtt
- entity: sensor.zigbee_log_level
- entity: sensor.zigbee_permit_join
type: entities
- entities:
- entity: switch.zigbee2mqtt_main_join
title: Switch
type: entities
Restart, set the switch to on
Then you can pair :
Press and hold the reset button on the device for ± 5 seconds (until the blue light starts blinking). After this the device will automatically join. If this doesn’t work, try with a single short button press.
- stay close to your ZigBee router
- for some Aqara devices I had to regularly push the button during pairing (every 3 seconds)