Yeelight 1S Color

[Discovery]how to force Home Assistant to re discover entities

https://www.msly.cn/boards/topic/14412/discoveryhow-to-force-home-assistant-to-re-discover-entities#18860

yeelight integration discovery

https://www.msly.cn/boards/topic/7318/8#20136

https://www.msly.cn/boards/topic/14412/discoveryhow-to-force-home-assistant-to-re-discover-entities#18860

Home Assistant New devices discovery

https://zhuanlan.zhihu.com/p/586183356

 

 

Yeelight-flex-switch-1.jpeg

 

Quick setup guide

Get the mi home app

sign in mi home app

Add device in mi home app

connect device to Wi-Fi Network
 

 

An option to enable LAN support and control it like the other devices
add the nightlight device via the Homekit Controller somehow
 

 

connect Yeelight device to Yeelight App

How to connect Yeelight devices to Yeelight App?

https://www.yeelight.com/faqs/yeelight-app

 

enable LAN mode on your lights

This problem is most probably due to the fact you did not enable LAN mode on your lights. And that is, because you are not using the Yeelight app.

 

Homekit Controller

 

The HomeKit server on your hub sends a structure to Home Assistant that maps your bulbs to an "aid". Each bulb should have its own aid. At startup HA loads the latest structure (we call it an entity map). If you look in those diagnostic files I asked for and search for "entity-map" you can see what your hub is presenting to us. For each aid, we should create a device. We inspect the characteristics and services data in the aid to work out what entities to create, and these are linked to the parent device.

 

According to the spec, the "aid" should not change, ever. Once a bulb is assigned an aid that should be it. It should stay the same if you restart the hub. It should stay the same if you upgrade firmware. The only exception might be if you completely removed a bulb from your bridge and then added again like it was a new bulb.

 

The bridge can add new aids and remove old ones. When it does this it sends a broadcast to every client telling them to fetch the new entity map. When we see the broadcast, we feetch the latest entity map. And we process it the same way we do at startup and add new entities. So if you add a new bulb to your Yeelight hub, it should appear in HA straight away without any intervenetion (if they follow the spec).

 

What we currently don't do is remove entities automatically. Ironically, its out of a fear of breaking something that was working. So if you remove a bulb from your Yellight hub, we'll carry on trying to process data for that aid. Thats why you see that error - an aid has gone away but we are still trying to use it.

 

The "fixes" we would do here are either to (a) delete the entity because it has disappeared or (b) mark the entity as unavailable. In general (a) is the correct thing according to the HomeKit spec. But neither of these things would actually fix your problem.

 

Restarting HA "fixes" this because the entities for the stale aids are not recreated at startup. So there are only aids for valid accessories. Until something causes the yeelight to renumber things again. Then the same thing happens again - there is a network wide broadcast, the entity map is replaced, new entities get created, old entities carry on trying to poll stale aids. It breaks.

 

Should I just create new entities are delete the olds ones? Well if the yeelight is just renumbering things randomly that won't actually help. You'll find that your entities will suddenly get renamed. light.bedroom might become light.bedroom_1 or even just light.yeelight_1234.

 

So thats why i'm trying to understand the data that your hub is returning. Are the aids changing because of a bug in the hub? Are the devices unavailable temporarily? Are we somehow getting an old version of the entity map, and thats what breaking things? Etc. The errors you see are symptoms, and not the cause, and actually don't help me narrow anything down unfortunately.

 

The file .storage/homekit_controller-entity-map should be relative to your configuration.yaml. So if you had /config/configuration.yaml you should also have /config/.storage/homekit_controller-entity-map

homekit_controller-entity-map  -new file

search key:mac address

mulit devices as follow

homekit_controller-entity-map-1.PNG

single device 

homekit_controller-entity-map-2.PNG

single device

homekit_controller-entity-map-3.PNG

 

homekit_controller-entity-map-4.PNG

 

core.config_entries

 

search key:domain=homekit_controller

core.config_entries-1.PNG

 

step 3: modify core.device_registry

core.device_registry

core.device_registry-1.PNG

 

core.device_registry-2.PNG

 

step 3:modify core.entity_registry

step3-core.entity_registry-1.PNG

 

step3-core.entity_registry-1-0.PNG

 

step3-core.entity_registry-2.PNG

 

 

step3-core.entity_registry-3.PNG

 

homekit_controller-entity-map

{
  "version": 1,
  "minor_version": 1,
  "key": "homekit_controller-entity-map",
  "data": {
    "pairings": {
      "7A:50:0E:FF:D9:01": {
        "config_num": 1,
        "accessories": [
          {
            "aid": 1,
            "services": [
              {
                "iid": 1,
                "type": "0000003E-0000-1000-8000-0026BB765291",
                "characteristics": [
                  {
                    "type": "00000014-0000-1000-8000-0026BB765291",
                    "iid": 2,
                    "perms": [
                      "pw"
                    ],
                    "format": "bool",
                    "description": "Identify"
                  },
                  {
                    "type": "00000020-0000-1000-8000-0026BB765291",
                    "iid": 3,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "Yeelight Technology",
                    "description": "Manufacturer",
                    "maxLen": 64
                  },
                  {
                    "type": "00000021-0000-1000-8000-0026BB765291",
                    "iid": 4,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "YLDP13YL",
                    "description": "Model",
                    "maxLen": 64
                  },
                  {
                    "type": "00000023-0000-1000-8000-0026BB765291",
                    "iid": 5,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "YLBulbColor1s-303B",
                    "description": "Name",
                    "maxLen": 64
                  },
                  {
                    "type": "00000030-0000-1000-8000-0026BB765291",
                    "iid": 6,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "475630149",
                    "description": "Serial Number",
                    "maxLen": 64
                  },
                  {
                    "type": "00000052-0000-1000-8000-0026BB765291",
                    "iid": 7,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "2.1.41",
                    "description": "Firmware Revision",
                    "maxLen": 64
                  },
                  {
                    "type": "00000053-0000-1000-8000-0026BB765291",
                    "iid": 8,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "1.2.0",
                    "description": "Hardware Revision",
                    "maxLen": 64
                  },
                  {
                    "type": "00000220-0000-1000-8000-0026BB765291",
                    "iid": 26,
                    "perms": [
                      "pr"
                    ],
                    "format": "data",
                    "value": "UFw62PZH0qI="
                  }
                ]
              },
              {
                "iid": 9,
                "type": "000000A2-0000-1000-8000-0026BB765291",
                "characteristics": [
                  {
                    "type": "00000037-0000-1000-8000-0026BB765291",
                    "iid": 10,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "1.1.0",
                    "description": "Version",
                    "maxLen": 64
                  }
                ]
              },
              {
                "iid": 11,
                "type": "00000043-0000-1000-8000-0026BB765291",
                "characteristics": [
                  {
                    "type": "00000025-0000-1000-8000-0026BB765291",
                    "iid": 12,
                    "perms": [
                      "pr",
                      "pw",
                      "ev"
                    ],
                    "format": "bool",
                    "value": true,
                    "description": "On"
                  },
                  {
                    "type": "00000023-0000-1000-8000-0026BB765291",
                    "iid": 13,
                    "perms": [
                      "pr"
                    ],
                    "format": "string",
                    "value": "Yeelight LED Color bulb2 SW",
                    "description": "Name",
                    "maxLen": 64
                  },
                  {
                    "type": "00000008-0000-1000-8000-0026BB765291",
                    "iid": 14,
                    "perms": [
                      "pr",
                      "pw",
                      "ev"
                    ],
                    "format": "int",
                    "value": 100,
                    "description": "Brightness",
                    "unit": "percentage",
                    "minValue": 0,
                    "maxValue": 100,
                    "minStep": 1
                  },
                  {
                    "type": "00000013-0000-1000-8000-0026BB765291",
                    "iid": 15,
                    "perms": [
                      "pr",
                      "pw",
                      "ev"
                    ],
                    "format": "float",
                    "value": 320.0,
                    "description": "Hue",
                    "unit": "arcdegrees",
                    "minValue": 0.0,
                    "maxValue": 360.0,
                    "minStep": 1.0
                  },
                  {
                    "type": "0000002F-0000-1000-8000-0026BB765291",
                    "iid": 16,
                    "perms": [
                      "pr",
                      "pw",
                      "ev"
                    ],
                    "format": "float",
                    "value": 2.0,
                    "description": "Saturation",
                    "unit": "percentage",
                    "minValue": 0.0,
                    "maxValue": 100.0,
                    "minStep": 1.0
                  }
                ]
              },
              {
                "iid": 17,
                "type": "6EF066C0-08F8-46DE-9581-B89B77E459E7",
                "characteristics": [
                  {
                    "type": "6EF066C2-08F8-46DE-9581-B89B77E459E7",
                    "iid": 18,
                    "perms": [
                      "pw",
                      "hd"
                    ],
                    "format": "string",
                    "description": "mijia bindkey value",
                    "maxLen": 64
                  },
                  {
                    "type": "6EF066C1-08F8-46DE-9581-B89B77E459E7",
                    "iid": 19,
                    "perms": [
                      "pr",
                      "hd"
                    ],
                    "format": "bool",
                    "value": true,
                    "description": "mijia bindkey configured value"
                  },
                  {
                    "type": "6EF066C3-08F8-46DE-9581-B89B77E459E7",
                    "iid": 20,
                    "perms": [
                      "pw",
                      "hd"
                    ],
                    "format": "string",
                    "description": "mijia country information",
                    "maxLen": 64
                  },
                  {
                    "type": "6EF066C4-08F8-46DE-9581-B89B77E459E7",
                    "iid": 21,
                    "perms": [
                      "pr",
                      "hd"
                    ],
                    "format": "string",
                    "value": "yeelink.light.color8",
                    "description": "mijia product model",
                    "maxLen": 64
                  },
                  {
                    "type": "6EF066C5-08F8-46DE-9581-B89B77E459E7",
                    "iid": 22,
                    "perms": [
                      "pr",
                      "hd"
                    ],
                    "format": "string",
                    "value": "475630149",
                    "description": "mijia product did",
                    "maxLen": 64
                  },
                  {
                    "type": "6EF066D1-08F8-46DE-9581-B89B77E459E7",
                    "iid": 23,
                    "perms": [
                      "pw",
                      "hd"
                    ],
                    "format": "string",
                    "description": "mijia WiFi country info",
                    "maxLen": 64
                  },
                  {
                    "type": "6EF066D2-08F8-46DE-9581-B89B77E459E7",
                    "iid": 24,
                    "perms": [
                      "pw",
                      "hd"
                    ],
                    "format": "int",
                    "description": "mijia gmt offset"
                  },
                  {
                    "type": "6EF066D3-08F8-46DE-9581-B89B77E459E7",
                    "iid": 25,
                    "perms": [
                      "pw",
                      "hd"
                    ],
                    "format": "string",
                    "description": "mijia config type",
                    "maxLen": 64
                  }
                ]
              }
            ]
          }
        ],
        "broadcast_key": null,
        "state_num": null
      }
    }
  }
}

 

 

 

useful links

How to connect Yeelight devices to Mi Home App?

https://www.yeelight.com/faqs/yeelight-app

How to connect Yeelight devices to Mi Home App?

https://www.yeelight.com/faqs/mihome-app

 

Comments


Comments are closed