Catalog introspection
getActionDomains, getServicesForDomain, getServiceParameters, getDomainStateOptions, getEntityDomains, getEntityFeatures, getHvacModeOptions, getFanModeOptions, getPlacePresenceOptions
Global functions available to smart-app code. Call them by bare name; there is no object to import.
| Function | Summary |
|---|---|
getActionDomains | Action-catalog lookups. |
getServicesForDomain | Services the action catalog lists for one domain, with labels for wizard UIs. |
getServiceParameters | Typed parameter specs for one service, for building a parameter form. |
getDomainStateOptions | Domain-aware trigger-state options. |
getEntityDomains | Canonical EntityDomain enum from @novon/contracts, surfaced as a { Sensor: 'sensor', Light: 'light', … } lookup so smart-app code can reference domains by name instead of hardcoded strings. |
getEntityFeatures | HA-style entity-feature bitmasks from @novon/contracts, grouped by domain. |
getHvacModeOptions | Canonical option list for the CLIMATE.setHvacMode service — surfaced from the host's ActionCatalog so every climate-adjacent smart app (Thermostat Scheduler, SimpleRule's setThermostat action, future climate apps) renders the same set without each file maintaining its own copy. |
getFanModeOptions | Canonical option list for the CLIMATE.setFanMode service. |
getPlacePresenceOptions | Option list for SimpleRule's place trigger/condition pickers: one {value: entityId, label: place name} per system.place_presence_* entity (PlacePresenceManager materializes these from the place-presence replicated body). |
getActionDomains
Action-catalog lookups. Backed by ActionCatalog.ts on the host — a curated registry of (domain, service, parameters) tuples a smart app can invoke. Used by wizard-style action builders (e.g. SimpleRule) to drive multi-page selection UIs.
Returning [] on missing-domain / missing-service rather than throwing so authors can chain getServicesForDomain(values.domain) before the user has chosen a domain.
Signature
function getActionDomains(): ActionDomainOption[]Parameters
None.
Returns
ActionDomainOption[]
See also
getServicesForDomain · capabilities
getServicesForDomain
Services the action catalog lists for one domain, with labels for wizard UIs.
Signature
function getServicesForDomain(domain: string): ActionServiceOption[]Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
domain | string | yes | — | Domain key such as light. Unknown domains return []. |
Returns
ActionServiceOption[]
See also
getServiceParameters
Typed parameter specs for one service, for building a parameter form.
Signature
function getServiceParameters(domain: string, service: string): ActionServiceParameter[]Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
domain | string | yes | — | Domain key. |
service | string | yes | — | Service name as passed to entity.<service>(). |
Returns
ActionServiceParameter[] — [] for unknown domain or service.
getDomainStateOptions
Domain-aware trigger-state options. Returns a flat list of domain.state choices across every known typed-state domain (light, lock, cover, …). The sensor domain is intentionally excluded by the host — sensor triggers want numeric comparisons, not equality — so callers can render a separate sensor-trigger form path.
Signature
function getDomainStateOptions(): Array<{ value: string; label: string }>Parameters
None.
Returns
Array<{ value: string; label: string }> — domain.state pairs for every typed-state domain; sensor is excluded on purpose.
getEntityDomains
Canonical EntityDomain enum from @novon/contracts, surfaced as a { Sensor: 'sensor', Light: 'light', … } lookup so smart-app code can reference domains by name instead of hardcoded strings. The exact keys mirror the contracts enum and may grow over time.
Signature
function getEntityDomains(): Record<string, string>Parameters
None.
Returns
Record<string, string> — { Light: "light", Switch: "switch", … }.
getEntityFeatures
HA-style entity-feature bitmasks from @novon/contracts, grouped by domain. Use as e.g. getEntityFeatures().Light.TRANSITION to resolve to a bit value that can be passed to a form input's requiresEntityFeature.featureBit.
Signature
function getEntityFeatures(): Record<string, Record<string, number>>Parameters
None.
Returns
Record<string, Record<string, number>> — Feature bitmasks per domain, e.g. getEntityFeatures().Light.TRANSITION.
getHvacModeOptions
Canonical option list for the CLIMATE.setHvacMode service — surfaced from the host's ActionCatalog so every climate-adjacent smart app (Thermostat Scheduler, SimpleRule's setThermostat action, future climate apps) renders the same set without each file maintaining its own copy. Distinct from the ClimateState enum in @novon/contracts: auto is a valid COMMAND mode but never a reported state (an auto-mode thermostat reports heat or cool depending on the leg it's actively driving).
Signature
function getHvacModeOptions(): Array<{ value: string; label: string }>Parameters
None.
Returns
Array<{ value: string; label: string }>
getFanModeOptions
Canonical option list for the CLIMATE.setFanMode service. Same single-source-of-truth pattern as getHvacModeOptions.
Signature
function getFanModeOptions(): Array<{ value: string; label: string }>Parameters
None.
Returns
Array<{ value: string; label: string }>
getPlacePresenceOptions
Option list for SimpleRule's place trigger/condition pickers: one {value: entityId, label: place name} per system.place_presence_* entity (PlacePresenceManager materializes these from the place-presence replicated body). Empty when the account has no places or the host binding isn't registered.
Signature
function getPlacePresenceOptions(): Array<{ value: string; label: string }>Parameters
None.
Returns
Array<{ value: string; label: string }> — One entry per system.place_presence_* entity; [] when the account has no places.