How to publish hue lights grouped in areas with mqtt?

I have single room ;test_room’ in my hue bridge with two lights: ‘Hue white lamp 1’ and ‘Hue white lamp 2’

Hass shows my ‘test_room’ as Area in Configuration->Areas
In Configuration->Devices I see both lights listed and “Area” column shows ‘test_room’

It is possible to publish this information with mqtt ?

I would like to publish to topic a payload like this:

/homeassistant/areas/test_room: ["hue white lamp1", "hue white lamp 2"]

so when I create new room ‘another room’ in hue bridge and add lights to it then hass will publish new topic /homeassistant/areas/another_room with payload as above.

Many thanks for any pointers

In Developer Tools > Events, it shows that there’s an event called area_registry_updated.

You could create an automation that uses an Event Trigger to listen for:
event_type: area_registry_updated

Beyond that, you’ll have to experiment to determine what is reported in event_data when a new room is created on the Hue bridge (or an existing room is modified). You will need that information to both constrain the Event Trigger to Hue-related activity and to publish it using mqtt.publish (in the automation’s action).

I updated hass to the latest version (0.110.6) and I do not see area_registry_updated on the available events list.

I start to listen to ‘*’ and when I change area for hue lamp I only get this event:

{
    "event_type": "device_registry_updated",
    "data": {
        "action": "update",
        "device_id": "409f4611e4c645d0b70bef182f19c6f8"
    },
    "origin": "LOCAL",
    "time_fired": "2020-06-11T16:20:40.727970+00:00",
    "context": {
        "id": "4a9291543afd4a37bddf34f7f715b3d1",
        "parent_id": null,
        "user_id": null
    }
}

Should I update to 0.111 to have area_registry_updated available?

I don’t know what you have to do to get that listener. I don’t see it on 0.111.0