custom-card-helpers
    Preparing search index...

    Interface HomeAssistant

    interface HomeAssistant {
        areas?: Record<string, AreaRegistryEntry>;
        auth: Auth;
        callApi: <T>(
            method: "GET" | "POST" | "PUT" | "DELETE",
            path: string,
            parameters?: { [key: string]: any },
        ) => Promise<T>;
        callService: (
            domain: string,
            service: string,
            serviceData?: Record<string, any>,
            target?: HassServiceTarget,
        ) => Promise<void>;
        callWS: <T>(msg: MessageBase) => Promise<T>;
        config: HassConfig;
        connected: boolean;
        connection: Connection;
        devices?: Record<string, DeviceRegistryEntry>;
        dockedSidebar: boolean;
        entities?: Record<string, EntityRegistryDisplayEntry>;
        fetchWithAuth: (
            path: string,
            init?: { [key: string]: any },
        ) => Promise<Response>;
        floors?: Record<string, FloorRegistryEntry>;
        formatEntityAttributeName?: (
            stateObj: HassEntity,
            attribute: string,
        ) => string;
        formatEntityAttributeValue?: (
            stateObj: HassEntity,
            attribute: string,
            value?: unknown,
        ) => string;
        formatEntityName?: (
            stateObj: HassEntity,
            name?: string | EntityNameItem | EntityNameItem[],
            options?: EntityNameOptions,
        ) => string;
        formatEntityState?: (stateObj: HassEntity, state?: string) => string;
        hassUrl: (path?: string) => string;
        language: string;
        locale: FrontendLocaleData;
        localize: LocalizeFunc;
        moreInfoEntityId: string;
        panels: Panels;
        panelUrl: string;
        resources: Resources;
        selectedLanguage: string | null;
        selectedTheme?: string | null;
        sendWS: (msg: MessageBase) => Promise<void>;
        services: HassServices;
        states: HassEntities;
        themes: Themes;
        translationMetadata: {
            fragments: string[];
            translations: { [lang: string]: Translation };
        };
        user: CurrentUser;
    }
    Index
    areas?: Record<string, AreaRegistryEntry>
    auth: Auth
    callApi: <T>(
        method: "GET" | "POST" | "PUT" | "DELETE",
        path: string,
        parameters?: { [key: string]: any },
    ) => Promise<T>
    callService: (
        domain: string,
        service: string,
        serviceData?: Record<string, any>,
        target?: HassServiceTarget,
    ) => Promise<void>
    callWS: <T>(msg: MessageBase) => Promise<T>
    config: HassConfig
    connected: boolean
    connection: Connection
    devices?: Record<string, DeviceRegistryEntry>
    dockedSidebar: boolean
    entities?: Record<string, EntityRegistryDisplayEntry>

    Entity registry keyed by entity_id.

    fetchWithAuth: (
        path: string,
        init?: { [key: string]: any },
    ) => Promise<Response>
    floors?: Record<string, FloorRegistryEntry>
    formatEntityAttributeName?: (stateObj: HassEntity, attribute: string) => string

    Home Assistant 2024.4

    formatEntityAttributeValue?: (
        stateObj: HassEntity,
        attribute: string,
        value?: unknown,
    ) => string

    Home Assistant 2024.4

    formatEntityName?: (
        stateObj: HassEntity,
        name?: string | EntityNameItem | EntityNameItem[],
        options?: EntityNameOptions,
    ) => string

    Formats an entity's display name from its registry context.

    Accepts a plain string (returned as-is), a single name item, an array of items joined with the separator, or undefined for the default name.

    Home Assistant 2026.4 in this shape. The helper exists from 2025.10, but took bare type strings then, and only accepted EntityNameItems between 2025.11 and 2026.3 - so feature detection is not sufficient, check hass.config.version before calling with a card's name option.

    formatEntityState?: (stateObj: HassEntity, state?: string) => string

    Home Assistant 2024.4

    hassUrl: (path?: string) => string
    language: string
    localize: LocalizeFunc
    moreInfoEntityId: string
    panels: Panels
    panelUrl: string
    resources: Resources
    selectedLanguage: string | null
    selectedTheme?: string | null
    sendWS: (msg: MessageBase) => Promise<void>
    services: HassServices
    states: HassEntities
    themes: Themes
    translationMetadata: {
        fragments: string[];
        translations: { [lang: string]: Translation };
    }