I am trying to get a Seeed ESP32 C6 to register in Home Assistant over Z2M. However, there is no Zigbee Mac and AI has hit a brick wall trying to get it sorted, due to there being no MAC transmitted so HA won't accept it for pairing.
According to AI, there is no way to initialise the Zigbee partition with Arduino, so it's pushing me over to ESP-IDF, but I's rather stay with Arduino if I can.
Grateful for advice please.
Here's the output of the code...
--- ZIGBEE INIT ---
[MAC] 58:E6:C5:14:38:70
[ZIGBEE] Init
[ZIGBEE] Stack initialised
[WIFI MAC] 0x58e6c5143870
[ZB MAC] 0x0000000000000000
[PAIRING] steering started
...this is what Z2M on HA is seeing...
[2026-05-07 09:02:07] debug : zh:ember:ezsp: ezspIncomingMessageHandler: type=UNICAST apsFrame={"profileId":260,"clusterId":6,"sourceEndpoint":1,"destinationEndpoint":1,"options":256,"groupId":0,"sequence":57} packetInfo:{"senderShortId":21594,"senderLongId":"0x0000000000000000","bindingIndex":255,"addressIndex":9,"lastHopLqi":164,"lastHopRssi":-59,"lastHopTimestamp":2462000105} messageContents=08390a00001000
...and this is the code...
#include <Arduino.h>
#include "esp_zigbee_core.h"
#include "esp_mac.h"
#define PAIR_BUTTON 9
static bool pairing = false;
static bool last_state = true;
static uint32_t press_start = 0;
// ==================== IEEE / MAC PRINT ====================
void print_zb_ext_addr(const uint8_t *ext_addr) {
Serial.print("[ZB MAC] 0x");
for (int i = 0; i < 8; i++) {
Serial.printf("%02x", ext_addr[7 - i]); // Zigbee big‑endian
}
Serial.println("");
}
void show_zigbee_ieee(void) {
Serial.println();
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_WIFI_STA);
Serial.print("[WIFI MAC] 0x");
for (int i = 0; i < 6; i++) {
Serial.printf("%02x", mac[i]);
}
Serial.println("");
uint8_t ext_addr[8];
esp_zb_get_long_address(ext_addr);
print_zb_ext_addr(ext_addr);
Serial.println();
}
// =================== ZIGBEE SIGNAL HANDLER ===================
void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct)
{
uint32_t *params = (uint32_t *)esp_zb_app_signal_get_params((uint32_t *)signal_struct);
esp_err_t status = ESP_FAIL;
if (params != NULL) {
status = (esp_err_t)(*params);
}
Serial.print("[ZB] status=");
Serial.println((int)status);
if (status == ESP_OK) {
Serial.println("[ZB] STEERING SUCCESS");
pairing = false;
}
}
// =================== ZIGBEE INIT ===================
void zigbee_init()
{
Serial.println("\n--- ZIGBEE INIT ---");
// ===================== MAC PRINT (debug) =====================
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_WIFI_STA);
Serial.printf("[MAC] %02X:%02X:%02X:%02X:%02X:%02X\n",
mac[0], mac[1], mac[2],
mac[3], mac[4], mac[5]);
Serial.println("[ZIGBEE] Init");
esp_zb_cfg_t cfg = {};
esp_zb_init(&cfg);
Serial.println("[ZIGBEE] Stack initialised");
// ============ PRINT ZIGBEE IEEE BEFORE JOIN ============
show_zigbee_ieee();
// ============ START PAIRING ===============
esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_NETWORK_STEERING);
pairing = true;
Serial.println("[PAIRING] steering started");
}
// =================== SETUP ===================
void setup()
{
Serial.begin(115200);
delay(500);
pinMode(PAIR_BUTTON, INPUT_PULLUP);
zigbee_init();
}
// =================== LOOP ===================
void loop()
{
delay(100);
}


