zigbee_esphome icon indicating copy to clipboard operation
zigbee_esphome copied to clipboard

Zigbee repeater/range extender example

Open ipartola opened this issue 6 months ago • 14 comments

I can't tell from the documentation if I could use an ESP32-C6 board to just act as a Zigbee range extender instead of actually having lights and/or sensors connected to it. Could this help extend the mesh network? Thank you!

ipartola avatar Jun 15 '25 20:06 ipartola

You could do that, just set router: true and define one dummy endpoint for example with device_type: test and a basic or identifying cluster without attributes. With the next update that won't be necessary anymore and one basic enpoint will always be created.

That said, if you plan to use wifi+zigbee don't expect the best performance. But please give it a try and share your experience.

luar123 avatar Jun 16 '25 05:06 luar123

You can even use the required endpoint to switch wifi on and off.

zigbee:
  id: zb
  router: true
  power_supply: 1
  endpoints:
    device_type: ON_OFF_LIGHT
    num: 1
    clusters:
      - id: ON_OFF
        attributes:
          attribute_id: 0
          type: bool
          id: zb_wifi
          on_value:
            if:
              condition:
                lambda: |-
                  return(x);
              then:
                wifi.enable
              else:
                wifi.disable

JochenFriedrich avatar Jul 13 '25 19:07 JochenFriedrich

@luar123 When do you think the next update will be done?

ETE-Design avatar Sep 14 '25 20:09 ETE-Design

Have it mostly working, just need to fix a few small things. But I am traveling in the next weeks. So maybe end of September but more likely until end of October.

luar123 avatar Sep 15 '25 14:09 luar123

@luar123 I saw your post and thought "that's brilliant, just what I need to extend out to an ESP32 that is at the end of my garden". I am trying to use your code but I just keep getting errors? I either get "no zigbee" or "no end point", and can't seem to get past this point. I have a nanetESP32-C6 v1.0 board. Is there a step by step guide that you could provide perhaps?

Mitsuperboy avatar Sep 27 '25 15:09 Mitsuperboy

Try the examples and work through the troubleshooting section. If that doesn't work and you want help provide full yaml and logs.

luar123 avatar Sep 28 '25 09:09 luar123

Now it should be enough to add

zigbee:
  id: zb
  router: true
  power_supply: 1
  components: None

luar123 avatar Oct 04 '25 11:10 luar123

@luar123 Is it possible that you can make it work with ESP32 also - Just the repeater function?

ETE-Design avatar Oct 05 '25 11:10 ETE-Design

Esp32 has no zigbee

luar123 avatar Oct 05 '25 11:10 luar123

Thank you again for looking into this. I am trying to use it with a ESP32-C6 which is meant to have zigbee. But I am getting errors still, please see below with my lines of code too;

" external_components:

  • source: github://luar123/zigbee_esphome components: [zigbee]

zigbee: id: zb router: true power_supply: 1 components: None "

''' INFO ESPHome 2025.9.1 INFO Reading configuration /config/esphome/new-greenhouse.yaml... Failed config

zigbee: [source /config/esphome/new-greenhouse.yaml:37]

Use 'partitions' in esp32 to specify a custom partition table including zigbee partitions. id: zb router: True power_supply: 1 components: none manufacturer: esphome date: 20251007 version: 0 area: 0 debug: False as_geenric: False '''

Mitsuperboy avatar Oct 07 '25 13:10 Mitsuperboy

Please have a look at the examples, you need to provide a partition csv with zigbee partitions:

esp32:
  board: esp32-c6-devkitc-1
  #flash_size: 4MB
  partitions: partitions_zb.csv
  framework:
    type: esp-idf

luar123 avatar Oct 14 '25 20:10 luar123

Thank you for this.

I have tried it and the code says that it is valid and it installs, but Zigbee2MQTT does not see the ESP32 and times out after 4 minutes? Is there anything else that I am missing?

This is my code below;

esphome: name: new-greenhouse friendly_name: New Greenhouse

ESP32 hardware configuration

esp32: board: esp32-c6-devkitc-1 #flash_size: 4MB partitions: partitions_zb.csv framework: type: esp-idf

Enable logging

logger:

Enable Home Assistant API

api: encryption: key: "xxxxxxxxxxxxxxxxxxxxxxxx"

ota:

  • platform: esphome password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

wifi: ssid: !secret wifi_ssid password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:

ssid: "New-Greenhouse Fallback Hotspot"

password: "xxxxxxxxxxxxxxxxxxxxx"

captive_portal:

External Zigbee component

external_components:

  • source: github://luar123/zigbee_esphome components: [zigbee]

Zigbee configuration

zigbee: id: zb router: true power_supply: 1 components: None on_join: then:

  • logger.log: "Joined network"

Mitsuperboy avatar Oct 15 '25 16:10 Mitsuperboy

@Mitsuperboy If you want help, please format your code and provide logs. For testing I would suggest to disable everything that is not needed (wifi, ap, ota, etc)

Put z2m in join mode, start/reset the esp and make sure it is close to your coordinator.

luar123 avatar Oct 16 '25 20:10 luar123

The repeater code works for me, but it has some strange behavior. But I dont know where to search for issues. I am using ESP32-C6, the device connects to the network as a router. But when I look at the map, the links between devices are either 0 or 0/0 (connected to other routers which are powered from the wall). I tried to place it close to the coordinator. It shows LQI 255, but still some routes with zero value.

My code:

esphome:
  name: zigbee-router
  friendly_name: zigbee-router

external_components:
  - source: github://luar123/zigbee_esphome
    components: [ zigbee ]

esp32:
  board: esp32-c6-devkitc-1
  partitions: partitions_zb.csv
  framework:
    type: esp-idf


# Enable logging
logger:
  hardware_uart: UART0

zigbee:
  id: zb
  router: true
  power_supply: 1
  components: None

When placed 1m from the coordinator... 😄

Image

jardastepan avatar Nov 04 '25 08:11 jardastepan