1. intro

in this case we r playing around with a switch from lidl

  • TS011F

  • by TZ3000_wamqdr3f

  • paired as ssw053

2. ZHA

in this sample we figured out how the mapping is done:

an entry in the zigbee.db file

sqlite3 config/zigbee.db "select * from devices_v11;"
e0:79:8d:ff:fe:7d:84:f0|0|2|1683986365.77944
50:32:5f:ff:fe:24:20:1b|62998|2|1683987611.83033

multiple config files:

config/.storage/core.device_registry

config/.storage/core.entity_registry

config/.storage/core.restore_state

cat config/.storage/core.device_registry
///
      {
        "area_id": "buro",
        "config_entries": [
          "992848292c5c2a50ec05306d6f18ba5b"
        ],
        "configuration_url": null,
        "connections": [
          [
            "zigbee",
            "e0:79:8d:ff:fe:7d:84:f0"                                      <<<<<
          ]
        ],
        "disabled_by": null,
        "entry_type": null,
        "hw_version": null,
        "id": "c60c762b25da6d1033fd05603284eac9",
        "identifiers": [
          [
            "zha",
            "e0:79:8d:ff:fe:7d:84:f0"
          ]
        ],
        "manufacturer": "ZHA",
        "model": "EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis",
        "name_by_user": "zig001",                                          <<<<<
        "name": "Zigbee Coordinator",
        "sw_version": null,
        "via_device_id": null
      },
///
      {
        "area_id": "salon",
        "config_entries": [
          "992848292c5c2a50ec05306d6f18ba5b"
        ],
        "configuration_url": null,
        "connections": [
          [
            "zigbee",
            "50:32:5f:ff:fe:24:20:1b"                                      <<<<<
          ]
        ],
        "disabled_by": null,
        "entry_type": null,
        "hw_version": null,
        "id": "8ac4dc8d995a01f2b17904c3800f2426",
        "identifiers": [
          [
            "zha",
            "50:32:5f:ff:fe:24:20:1b"
          ]
        ],
        "manufacturer": "_TZ3000_wamqdr3f",
        "model": "TS011F",
        "name_by_user": "ssw053",                                          <<<<<
        "name": "_TZ3000_wamqdr3f TS011F",
        "sw_version": null,
        "via_device_id": "c60c762b25da6d1033fd05603284eac9"
      }
///
cat config/.storage/core.entity_registry
cat config/.storage/core.restore_state
///
      {
        "aliases": [],
        "area_id": null,
        "capabilities": {
          "options": [
            "Off",
            "LightWhenOn",
            "LightWhenOff"
          ]
        },
        "config_entry_id": "992848292c5c2a50ec05306d6f18ba5b",
        "device_class": null,
        "device_id": "8ac4dc8d995a01f2b17904c3800f2426",
        "disabled_by": null,
        "entity_category": "config",
        "entity_id": "select.ssw053_backlight_mode",
        "hidden_by": null,
        "icon": null,
        "id": "777a57d7499c900b4565f71002db527a",
        "has_entity_name": true,
        "name": "ssw053 Backlight mode",
        "options": {
          "conversation": {
            "should_expose": false
          }
        },
///
      {
        "aliases": [],
        "area_id": null,
        "capabilities": null,
        "config_entry_id": "992848292c5c2a50ec05306d6f18ba5b",
        "device_class": null,
        "device_id": "8ac4dc8d995a01f2b17904c3800f2426",
        "disabled_by": null,
        "entity_category": "diagnostic",
        "entity_id": "button.ssw053_identify",
        "hidden_by": null,
        "icon": null,
        "id": "afd06740255f6f3e9900ab4953488a5d",
        "has_entity_name": true,
        "name": "ssw053 Identify",
        "options": {
          "conversation": {
            "should_expose": false
          }
///
      {
        "aliases": [],
        "area_id": null,
        "capabilities": {
          "options": [
            "Off",
            "On",
            "LastState"
          ]
        },
        "config_entry_id": "992848292c5c2a50ec05306d6f18ba5b",
        "device_class": null,
        "device_id": "8ac4dc8d995a01f2b17904c3800f2426",
        "disabled_by": null,
        "entity_category": "config",
        "entity_id": "select.ssw053_power_on_state",
        "hidden_by": null,
        "icon": null,
        "id": "d617491483b5db266d6356af97ce55df",
        "has_entity_name": true,
        "name": "ssw053 Power on state",
        "options": {
          "conversation": {
            "should_expose": false
          }
///
      {
        "aliases": [],
        "area_id": null,
        "capabilities": null,
        "config_entry_id": "992848292c5c2a50ec05306d6f18ba5b",
        "device_class": null,
        "device_id": "8ac4dc8d995a01f2b17904c3800f2426",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "switch.ssw053_switch",
        "hidden_by": null,
        "icon": null,
        "id": "a83fd50313960c508a2968461cb9bc2e",
        "has_entity_name": true,
        "name": "ssw053 Switch",
        "options": {
          "conversation": {
            "should_expose": true
          }
///

2.1. rename the device

cube config/.storage/core.device_registry "ssw053" with "abc123"
cube config/.storage/core.entity_registry "ssw053" with "abc123"
cube config/.storage/core.restore_state "ssw053" with "abc123"
ha core restart

or

cube config/.storage/core.device_registry "ssw053" with "abc123"
cube config/.storage/core.entity_registry "ssw053" with "abc123"
rm config/.storage/core.restore_state
systemctl restart docker.socket
sleep 10
ha core start

3. zigbee2mqtt

cat config/zigbee2mqtt/database.db | jq
///
{
  "id": 2,
  "type": "Router",
  "ieeeAddr": "0x50325ffffe24201b",                                        <<<<<
  "nwkAddr": 22196,
  "manufId": 4098,
  "manufName": "_TZ3000_wamqdr3f",
  "powerSource": "Mains (single phase)",
  "modelId": "TS011F",
  "epList": [
    1,
    11,
    242
  ],
  "endpoints": {
    "1": {
      "epId": 1,
      "inClusterList": [],
      "outClusterList": [],
      "clusters": {
        "genBasic": {
          "attributes": {
            "modelId": "TS011F",                                           <<<<<
            "manufacturerName": "_TZ3000_wamqdr3f"                         <<<<<
          }
        }
      },
      "binds": [],
      "configuredReportings": [],
      "meta": {}
    },
///
cat config/zigbee2mqtt/configuration.yaml
homeassistant: true
mqtt:
  server: mqtt://d01cid.ddns.net
  user: admin
  password: Passw0rd
serial:
  port: /dev/ttyACM0
  adapter: ezsp
frontend:
  port: 8099
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false
devices:
  '0x50325ffffe24201b':
    friendly_name: ssw059                                                  <<<<<