Light Switch platform doesn't create entities (does not have unique ID), however it's 100% unique

Hi all,

I am trying to make use of the Light Switch platform (https://www.home-assistant.io/integrations/light.switch/) to create “virtual” entities of my lights which are controlled by wired switches (Aqara D1).

For that, I added the following to configuration.yaml

light:
  - platform: switch
    name: l1_hallway_ceiling1
    entity_id: switch.swtwal18_left
  - platform: switch
    name: l1_hallway_ceiling2
    entity_id: switch.swtwal02_right
  - platform: switch
    name: l2_hallway_ceiling1
    entity_id: switch.swtwal09_right
  - platform: switch
    name: l2_hallway_ceiling2
    entity_id: switch.swtwal09_left

It worked for three of them, but not for l1_hallway_ceiling2.

The failed l1_hallway_ceiling2 is even shown as a Light integration as seen on the screenshot above, while the other three are of type Switch integration.

The entity for l1_hallway_ceiling2 is shown in HA (even though as failed), but does not exist in core.entity_registry at all. While HA automatically created three entries in core.entity_registry for the working ones upon restart:

$ egrep l?_hallway_ceiling? core.entity_registry
                "entity_id": "light.l1_hallway_ceiling1",
                "original_name": "l1_hallway_ceiling1",
                "entity_id": "light.l2_hallway_ceiling2",
                "original_name": "l2_hallway_ceiling2",
                "entity_id": "light.l2_hallway_ceiling1",
                "original_name": "l2_hallway_ceiling1",

Looks to me the error message “does not have a unique ID” is wrong.

There is nothing to be seen in the logs.

Appreciate your help.

Thanks!

Got it solved!
There was a typo in the underlying switch for l1_hallway_ceiling2 (switch.swtwal02_right, however I named it switch.swtwal02_rightbtn).

The integration type (light) and the unique ID error message are quite misleading. @Tinkerer pointed me to the right direction on Discord, it was simply that the entity was unavailable. Thanks man!