State of Zigbee2mqtt device endpoints

I use this script in the lights.yaml for getting a Gledopto GL-C-007-2ID light controller into HA. This has endpoints for RGB and White and I am able to control them but what is the syntax for getting the state of these two endpoints?

  - platform: "mqtt"
    name: "Outside"
    state_topic: "zigbee2mqtt/light_outside"
    availability_topic: "zigbee2mqtt/bridge/state"
    brightness: true
    color_temp: false
    schema: "json"
    command_topic: "zigbee2mqtt/light_outside/white/set"

I have tried this but it does not work
state_topic: "zigbee2mqtt/light_outside/white"

Z2M will pass along the device (including state) to HA without requiring any manual Yaml config, provided you set it up correctly.

Who gave you the idea that you need to manually create Yaml for each device when using Z2M?

I forgot to mention that I am on an old version of HA (0.103.6) I know!!
Anyway all my Z2M devices are configured in Yaml but none with more than one endpoint.
Maybe someone in here knows how to define the state topic for both in Yaml.

Dude, just… upgrade.

Nobody knows how to adress the different endpoints from Z2M in Yaml?

Probably not “Nobody” but I suspect it will be a small group of people that have a clear recollection of how a 6+ year old version of HA works - thats before my “HA Time”.

Current versions of HA and Z2M handle it automatically via auto-discovery, so it’s not necessary to know how to do it any more. As such there is no reason to spend any time figuring out how to do it in current HA versions - it’s not something I will ever need to do.

Even when I build my own MQTT integrations, I use auto-discovery instead of configuring via YAML.