mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-12-19 11:23:33 +00:00
238 lines
6.8 KiB
TypeScript
238 lines
6.8 KiB
TypeScript
/**
|
||
* Represents a MQTT Scene component for Home Assistant MQTT Discovery.
|
||
*
|
||
* The `mqtt` scene platform lets you control your MQTT enabled scenes.
|
||
*
|
||
* For detailed documentation see:
|
||
* https://www.home-assistant.io/integrations/scene.mqtt/
|
||
*/
|
||
export interface SceneComponent {
|
||
/**
|
||
* Must be `scene`. Only allowed and required in [MQTT auto discovery device messages](https://www.home-assistant.io/integrations/mqtt/#device-discovery-payload).
|
||
*/
|
||
platform: 'scene';
|
||
|
||
/**
|
||
* An ID that uniquely identifies this scene entity.
|
||
* If two scenes have the same unique ID, Home Assistant will raise an exception.
|
||
* Required when used with device-based discovery.
|
||
*/
|
||
unique_id?: string;
|
||
|
||
/**
|
||
* The MQTT topic to publish `payload_on` to activate the scene.
|
||
*/
|
||
command_topic?: string;
|
||
|
||
/**
|
||
* The payload that will be sent to `command_topic` when activating the MQTT scene.
|
||
* Default: "ON"
|
||
*/
|
||
payload_on?: string;
|
||
|
||
/**
|
||
* A list of MQTT topics subscribed to receive availability (online/offline) updates.
|
||
* Must not be used together with `availability_topic`.
|
||
*/
|
||
availability?: Array<{
|
||
/**
|
||
* An MQTT topic subscribed to receive availability (online/offline) updates.
|
||
*/
|
||
topic: string;
|
||
|
||
/**
|
||
* The payload that represents the available state.
|
||
* Default: "online"
|
||
*/
|
||
payload_available?: string;
|
||
|
||
/**
|
||
* The payload that represents the unavailable state.
|
||
* Default: "offline"
|
||
*/
|
||
payload_not_available?: string;
|
||
|
||
/**
|
||
* Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt)
|
||
* to extract device's availability from the `topic`.
|
||
* To determine the device's availability, result of this template will be compared to `payload_available` and `payload_not_available`.
|
||
*/
|
||
value_template?: string;
|
||
}>;
|
||
|
||
/**
|
||
* When `availability` is configured, this controls the conditions needed to set the entity to `available`.
|
||
* Valid values: "all", "any", "latest"
|
||
* Default: "latest"
|
||
*
|
||
* If set to `all`, `payload_available` must be received on all configured availability topics before
|
||
* the entity is marked as online.
|
||
* If set to `any`, `payload_available` must be received on at least one configured availability topic before
|
||
* the entity is marked as online.
|
||
* If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic
|
||
* controls the availability.
|
||
*/
|
||
availability_mode?: 'all' | 'any' | 'latest';
|
||
|
||
/**
|
||
* Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt)
|
||
* to extract device's availability from the `availability_topic`.
|
||
* To determine the device's availability, result of this template will be compared to `payload_available` and `payload_not_available`.
|
||
*/
|
||
availability_template?: string;
|
||
|
||
/**
|
||
* The MQTT topic subscribed to receive availability (online/offline) updates.
|
||
* Must not be used together with `availability`.
|
||
*/
|
||
availability_topic?: string;
|
||
|
||
/**
|
||
* The payload that represents the available state.
|
||
* Default: "online"
|
||
*/
|
||
payload_available?: string;
|
||
|
||
/**
|
||
* The payload that represents the unavailable state.
|
||
* Default: "offline"
|
||
*/
|
||
payload_not_available?: string;
|
||
|
||
/**
|
||
* Information about the device this scene is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html).
|
||
* Only works when [`unique_id`](#unique_id) is set.
|
||
* At least one of identifiers or connections must be present to identify the device.
|
||
*/
|
||
device?: {
|
||
/**
|
||
* A link to the webpage that can manage the configuration of this device.
|
||
* Can be either an `http://` or `https://` URL.
|
||
*/
|
||
configuration_url?: string;
|
||
|
||
/**
|
||
* A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`.
|
||
* For example the MAC address of a network interface:
|
||
* `"connections": [["mac", "02:5b:26:a8:dc:12"]]`.
|
||
*/
|
||
connections?: Array<[string, string]>;
|
||
|
||
/**
|
||
* The hardware version of the device.
|
||
*/
|
||
hw_version?: string;
|
||
|
||
/**
|
||
* A list of IDs that uniquely identify the device.
|
||
* For example a serial number.
|
||
*/
|
||
identifiers?: string[] | string;
|
||
|
||
/**
|
||
* The manufacturer of the device.
|
||
*/
|
||
manufacturer?: string;
|
||
|
||
/**
|
||
* The model of the device.
|
||
*/
|
||
model?: string;
|
||
|
||
/**
|
||
* The model identifier of the device.
|
||
*/
|
||
model_id?: string;
|
||
|
||
/**
|
||
* The name of the device.
|
||
*/
|
||
name?: string;
|
||
|
||
/**
|
||
* The serial number of the device.
|
||
*/
|
||
serial_number?: string;
|
||
|
||
/**
|
||
* Suggest an area if the device isn’t in one yet.
|
||
*/
|
||
suggested_area?: string;
|
||
|
||
/**
|
||
* The firmware version of the device.
|
||
*/
|
||
sw_version?: string;
|
||
|
||
/**
|
||
* Identifier of a device that routes messages between this device and Home Assistant.
|
||
* Examples of such devices are hubs, or parent devices of a sub-device.
|
||
* This is used to show device topology in Home Assistant.
|
||
*/
|
||
via_device?: string;
|
||
};
|
||
|
||
/**
|
||
* Flag which defines if the entity should be enabled when first added.
|
||
* Default: true
|
||
*/
|
||
enabled_by_default?: boolean;
|
||
|
||
/**
|
||
* The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity.
|
||
*/
|
||
entity_category?: string;
|
||
|
||
/**
|
||
* Picture URL for the entity.
|
||
*/
|
||
entity_picture?: string;
|
||
|
||
/**
|
||
* The encoding of the published messages.
|
||
* Default: "utf-8"
|
||
*/
|
||
encoding?: string;
|
||
|
||
/**
|
||
* Icon for the scene.
|
||
*/
|
||
icon?: string;
|
||
|
||
/**
|
||
* Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt)
|
||
* to extract the JSON dictionary from messages received on the `json_attributes_topic`.
|
||
* Usage example can be found in [MQTT sensor](https://www.home-assistant.io/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation.
|
||
*/
|
||
json_attributes_template?: string;
|
||
|
||
/**
|
||
* The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes.
|
||
* Usage example can be found in [MQTT sensor](https://www.home-assistant.io/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation.
|
||
*/
|
||
json_attributes_topic?: string;
|
||
|
||
/**
|
||
* The name to use when displaying this scene.
|
||
* Default: "MQTT Scene"
|
||
*/
|
||
name?: string;
|
||
|
||
/**
|
||
* Used instead of `name` for automatic generation of `entity_id`.
|
||
*/
|
||
object_id?: string;
|
||
|
||
/**
|
||
* The maximum QoS level to be used when receiving and publishing messages.
|
||
* Default: 0
|
||
*/
|
||
qos?: number;
|
||
|
||
/**
|
||
* If the published message should have the retain flag on or not.
|
||
* Default: false
|
||
*/
|
||
retain?: boolean;
|
||
}
|