How to declare a host attribute in a plugin so its renderable in table and searchable?

Hello,

i want to write a plugin an declare host attributes, that are visible in tables and searchable.

I found that there are two ways, to declare.

Old Style with:

declare_host_attribute(
    NagiosTextAttribute(
        "long",
        "_LONG",
        "Longitude",
        "Longitude",
    ),
    show_in_table=False,
    show_in_folder=False,
)

and new style with:

@host_attribute_registry.register
class HostAttributeExample(ABCHostAttributeText):
    def name(self):
        return "example"

    def title(self):
        return "Example"

    def topic(self):
        return HostAttributeTopicBasicSettings

    def openapi_field(self):
        return fields.String(description=self.help())

The Attributes are both visible and editable in the Host/Folder Forms.
But i cant use them in tables.

I wrote a Painter:

@painter_registry.register
class PainterExample(Painter):
    @property
    def ident(self) -> str:
        return "example"

    def title(self, cell: Cell) -> str:
        return _("Example")

    @property
    def columns(self):
        return ["example"]

    def render(self, row: Row, cell: Cell):
        return ("", row["example"])

And it not show up. I think its because its not know in livestatus.
So i decided to use cmk.base.config, but after doing a config.load() and config.get_config_cache().get_host_config(row["host_name")).
I cant see the attribute anywhere.

Anyone know how to do it the right way?

Kind regards
Christian