Using anchors and aliases to define light entities

Hi,

I have several hue leds and strips and I want to reuse entity definition with anchors and aliases ( YAML Ain’t Markup Language (YAML™) revision 1.2.2).

I simplified my settings to reuse only platform. In reality there would be way more settings to reuse.

HA accepts this as valid yaml.

innr:
  <<: &anchor
  - platform: "mqtt"

innrtest:
  <<: *anchor
  name: "Innr Ledstrip test"
  command_topic: "zigbee2mqtt/ledstrip/bureau/set"
  
   
innrRob:
  <<: *anchor
  name: "ROB Ledstrip test"
  command_topic: "zigbee2mqtt/ledstrip/bureau/set"

The defined leds do not show up in the entities,
Any suggestions?
Are anchors not supported in HA?
Thanks

I reworked my yaml.

  - command_topic: "dummy"
    <<: &anchor
      platform: "mqtt"
      qos: 2
      retain: true
      availability_topic: "zigbee2mqtt/bridge/state"
      brightness: true
      schema: "json"
      brightness_scale: 254
      color_mode: true
      supported_color_modes: 
        - "xy"
        - "color_temp"
      max_mireds: 500
      min_mireds: 150
      effect: true
      effect_list: 
        - "blink"
        - "breathe"
        - "okay"
        - "channel_change"
        - "finish_effect"
        - "stop_effect"

  - name: "Rob Ledstrip test"
    unique_id: innr_ledstrip_rob
    command_topic: "zigbee2mqtt/ledstrip/bureautest/set"
    state_topic: "zigbee2mqtt/ledstrip/test/state"
    <<: *anchor

When I look into a json representation of this yaml, it looks correct but HA does not add unique_id: innr_ledstrip_rob.
It now produces an array which was not the case in my previous yaml.

JSON:

[
  {
    "command_topic": "dummy",
    "platform": "mqtt",
    "qos": 2,
    "retain": true,
    "availability_topic": "zigbee2mqtt/bridge/state",
    "brightness": true,
    "schema": "json",
    "brightness_scale": 254,
    "color_mode": true,
    "supported_color_modes": [
      "xy",
      "color_temp"
    ],
    "max_mireds": 500,
    "min_mireds": 150,
    "effect": true,
    "effect_list": [
      "blink",
      "breathe",
      "okay",
      "channel_change",
      "finish_effect",
      "stop_effect"
    ]
  },
  {
    "platform": "mqtt",
    "name": "Rob Ledstrip test",
    "unique_id": "innr_ledstrip_rob",
    "command_topic": "zigbee2mqtt/ledstrip/bureautest/set",
    "state_topic": "zigbee2mqtt/ledstrip/test/state",
    "qos": 2,
    "retain": true,
    "availability_topic": "zigbee2mqtt/bridge/state",
    "brightness": true,
    "schema": "json",
    "brightness_scale": 254,
    "color_mode": true,
    "supported_color_modes": [
      "xy",
      "color_temp"
    ],
    "max_mireds": 500,
    "min_mireds": 150,
    "effect": true,
    "effect_list": [
      "blink",
      "breathe",
      "okay",
      "channel_change",
      "finish_effect",
      "stop_effect"
    ]
  }
]

Very weird. For some reason the entity was not added. When I start playing around with unique id it worked.