mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 15:47:08 +00:00
Set battery entity categories to 'diagnostic' to hide them from the main view
This commit is contained in:
parent
7fb4a35a41
commit
8dfd40a5d7
@ -1,6 +1,11 @@
|
||||
<!-- https://developers.home-assistant.io/docs/add-ons/presentation#keeping-a-changelog -->
|
||||
|
||||
|
||||
## 0.1.1 (24.07.2025)
|
||||
|
||||
- Set 'battery' entity category to 'diagnostic' to hide it from the main HA view.
|
||||
- Do not expose 'battery' entity twice if it supports both level and low/high binary state.
|
||||
|
||||
## 0.1.0 (24.07.2025)
|
||||
|
||||
**Initial stable release**
|
||||
|
@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: Futurehome
|
||||
version: "0.1.0"
|
||||
version: "0.1.1"
|
||||
slug: futurehome
|
||||
description: Local Futurehome Smarthub integration
|
||||
url: "https://github.com/adrianjagielak/home-assistant-futurehome"
|
||||
|
1
futurehome/src/ha/mqtt_components/_enums.ts
Normal file
1
futurehome/src/ha/mqtt_components/_enums.ts
Normal file
@ -0,0 +1 @@
|
||||
export type EntityCategory = undefined | 'config' | 'diagnostic';
|
@ -26,6 +26,16 @@ export interface AlarmControlPanelComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive state updates.
|
||||
* A `None` payload resets to an `unknown` state.
|
||||
@ -89,16 +99,6 @@ export interface AlarmControlPanelComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -13,6 +13,17 @@ export interface BinarySensorComponent {
|
||||
*/
|
||||
platform: 'binary_sensor';
|
||||
|
||||
/**
|
||||
* The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity.
|
||||
* When set, the entity category must be `diagnostic` for sensors.
|
||||
*/
|
||||
entity_category?: string;
|
||||
|
||||
/**
|
||||
* Picture URL for the entity.
|
||||
*/
|
||||
entity_picture?: string;
|
||||
|
||||
/**
|
||||
* An ID that uniquely identifies this sensor.
|
||||
* If two sensors have the same unique ID, Home Assistant will raise an exception.
|
||||
@ -103,17 +114,6 @@ export interface BinarySensorComponent {
|
||||
*/
|
||||
qos?: number;
|
||||
|
||||
/**
|
||||
* The [category](https://developers.home-assistant.io/docs/core/entity/#generic-properties) of the entity.
|
||||
* When set, the entity category must be `diagnostic` for sensors.
|
||||
*/
|
||||
entity_category?: string;
|
||||
|
||||
/**
|
||||
* Picture URL for the entity.
|
||||
*/
|
||||
entity_picture?: string;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -21,6 +21,16 @@ export interface ButtonComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to trigger the button.
|
||||
*/
|
||||
@ -56,16 +66,6 @@ export interface ButtonComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -22,6 +22,16 @@ export interface CameraComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to subscribe to.
|
||||
*/
|
||||
@ -41,16 +51,6 @@ export interface CameraComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -20,6 +20,16 @@ export interface ClimateComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* A template to render the value received on the `action_topic` with.
|
||||
*/
|
||||
@ -57,79 +67,6 @@ export interface ClimateComponent {
|
||||
*/
|
||||
current_temperature_topic?: string;
|
||||
|
||||
/**
|
||||
* Information about the device this HVAC device 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://`, `https://` or an internal `homeassistant://` 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[];
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@ -143,16 +80,6 @@ export interface ClimateComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* A template to render the value sent to the `fan_mode_command_topic` with.
|
||||
*/
|
||||
|
@ -20,6 +20,16 @@ export interface CoverComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to control the cover.
|
||||
*/
|
||||
@ -45,16 +55,6 @@ export interface CoverComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -25,6 +25,16 @@ export interface DeviceAutomationComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 type of automation, must be 'trigger'.
|
||||
*/
|
||||
|
@ -21,6 +21,16 @@ export interface DeviceTrackerComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive device tracker state changes.
|
||||
* The states defined in `state_topic` override the location states defined by the `json_attributes_topic`.
|
||||
|
@ -23,6 +23,16 @@ export interface EventComponent {
|
||||
*/
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive JSON event payloads.
|
||||
* The JSON payload should contain the `event_type` element.
|
||||
@ -54,16 +64,6 @@ export interface EventComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
|
@ -18,7 +18,17 @@ export interface FanComponent {
|
||||
* If two fans have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to change the fan state.
|
||||
@ -183,16 +193,6 @@ export interface FanComponent {
|
||||
*/
|
||||
retain?: 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -18,7 +18,17 @@ export interface HumidifierComponent {
|
||||
* If two humidifiers have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to change the humidifier state.
|
||||
@ -203,16 +213,6 @@ export interface HumidifierComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -23,7 +23,17 @@ export interface ImageComponent {
|
||||
* If two images have the same unique ID Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to subscribe to receive the image payload of the image to be downloaded.
|
||||
@ -99,91 +109,8 @@ export interface ImageComponent {
|
||||
*/
|
||||
json_attributes_template?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* Information about the device this image is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html).
|
||||
* Only works through [MQTT discovery](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery) and 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://`, `https://` or an internal `homeassistant://` 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[];
|
||||
|
||||
/**
|
||||
* 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;
|
||||
};
|
||||
}
|
||||
|
@ -18,7 +18,17 @@ export interface LawnMowerComponent {
|
||||
* If two lawn mowers have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive an update of the activity.
|
||||
@ -60,16 +70,6 @@ export interface LawnMowerComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -19,7 +19,17 @@ export interface LightComponent {
|
||||
* If two lights have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Flag that defines if light supports brightness when the `rgb`, `rgbw`, or `rgbww` color mode is supported.
|
||||
@ -336,16 +346,6 @@ export interface LightComponent {
|
||||
*/
|
||||
object_id?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -18,7 +18,17 @@ export interface LockComponent {
|
||||
* If two locks have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to change the lock state.
|
||||
@ -60,16 +70,6 @@ export interface LockComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -23,7 +23,17 @@ export interface ManualMqttComponent {
|
||||
* If two manual alarm control panels have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic Home Assistant will publish state updates to.
|
||||
|
@ -20,7 +20,17 @@ export interface NotifyComponent {
|
||||
* If two notify entities have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish send message commands at.
|
||||
@ -39,16 +49,6 @@ export interface NotifyComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -21,7 +21,17 @@ export interface NumberComponent {
|
||||
* If two number entities have the same unique ID Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to change the number.
|
||||
@ -92,16 +102,6 @@ export interface NumberComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -17,7 +17,17 @@ export interface SceneComponent {
|
||||
* If two scenes have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish `payload_on` to activate the scene.
|
||||
@ -48,16 +58,6 @@ export interface SceneComponent {
|
||||
*/
|
||||
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"
|
||||
|
@ -21,7 +21,17 @@ export interface SelectComponent {
|
||||
* If two selects have the same unique ID Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive update of the selected option.
|
||||
@ -82,16 +92,6 @@ export interface SelectComponent {
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -21,7 +21,18 @@ export interface SensorComponent {
|
||||
* If two sensors have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity.
|
||||
* When set, the entity category must be `diagnostic` for sensors.
|
||||
*/
|
||||
entity_category?: string;
|
||||
|
||||
/**
|
||||
* Picture URL for the entity.
|
||||
*/
|
||||
entity_picture?: string;
|
||||
|
||||
/**
|
||||
* The MQTT topic subscribed to receive sensor values.
|
||||
@ -94,17 +105,6 @@ export interface SensorComponent {
|
||||
*/
|
||||
qos?: number;
|
||||
|
||||
/**
|
||||
* The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity.
|
||||
* When set, the entity category must be `diagnostic` for sensors.
|
||||
*/
|
||||
entity_category?: string;
|
||||
|
||||
/**
|
||||
* Picture URL for the entity.
|
||||
*/
|
||||
entity_picture?: string;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -17,7 +17,17 @@ export interface SirenComponent {
|
||||
* If two sirens have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* List of available tones the siren supports. When configured, this enables the support for setting a `tone` and enables the `tone` state attribute.
|
||||
@ -51,16 +61,6 @@ export interface SirenComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -18,7 +18,17 @@ export interface SwitchComponent {
|
||||
* If two switches have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to change the switch state.
|
||||
@ -51,16 +61,6 @@ export interface SwitchComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -18,7 +18,17 @@ export interface TagComponent {
|
||||
* If two tags have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive tag scanned events.
|
||||
|
@ -19,7 +19,17 @@ export interface TextComponent {
|
||||
* If two text entities have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish the text value that is set.
|
||||
@ -94,16 +104,6 @@ export interface TextComponent {
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
|
@ -18,7 +18,17 @@ export interface UpdateComponent {
|
||||
* An ID that uniquely identifies this update entity.
|
||||
* If two update entities have the same unique ID, Home Assistant will raise an exception.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic subscribed to receive state updates.
|
||||
@ -80,16 +90,6 @@ export interface UpdateComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -19,7 +19,17 @@ export interface VacuumComponent {
|
||||
* If two vacuums have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to control the vacuum.
|
||||
|
@ -20,7 +20,17 @@ export interface ValveComponent {
|
||||
* If two valves have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 MQTT topic to publish commands to control the valve.
|
||||
@ -182,16 +192,6 @@ export interface ValveComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -18,7 +18,17 @@ export interface WaterHeaterComponent {
|
||||
* If two water heaters have the same unique ID, Home Assistant will raise an exception.
|
||||
* Required when used with device-based discovery.
|
||||
*/
|
||||
unique_id?: string;
|
||||
unique_id: string;
|
||||
|
||||
/**
|
||||
* 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 name of the water heater.
|
||||
@ -45,16 +55,6 @@ export interface WaterHeaterComponent {
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* [Icon](https://www.home-assistant.io/docs/configuration/customizing-devices/#icon) for the entity.
|
||||
*/
|
||||
|
@ -12,23 +12,23 @@ export function battery__components(
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
|
||||
if (svc.intf?.includes('evt.alarm.report')) {
|
||||
components[`${svc.addr}_alarm`] = {
|
||||
unique_id: `${svc.addr}_alarm`,
|
||||
platform: 'binary_sensor',
|
||||
device_class: 'battery',
|
||||
value_template: `{{ (value_json['${svc.addr}'].alarm.status == 'activ') | iif('ON', 'OFF') }}`,
|
||||
};
|
||||
}
|
||||
|
||||
if (svc.intf?.includes('evt.lvl.report')) {
|
||||
components[`${svc.addr}_lvl`] = {
|
||||
unique_id: `${svc.addr}_lvl`,
|
||||
platform: 'sensor',
|
||||
entity_category: 'diagnostic',
|
||||
device_class: 'battery',
|
||||
unit_of_measurement: svc.props?.sup_units?.[0] ?? '%',
|
||||
value_template: `{{ value_json['${svc.addr}'].lvl }}`,
|
||||
};
|
||||
} else if (svc.intf?.includes('evt.alarm.report')) {
|
||||
components[`${svc.addr}_alarm`] = {
|
||||
unique_id: `${svc.addr}_alarm`,
|
||||
platform: 'binary_sensor',
|
||||
entity_category: 'diagnostic',
|
||||
device_class: 'battery',
|
||||
value_template: `{{ (value_json['${svc.addr}'].alarm.status == 'activ') | iif('ON', 'OFF') }}`,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user