Compare commits

..

2 Commits

Author SHA1 Message Date
jbouwh
f09ccdd45d Use placeholder instead of URL 2025-10-13 20:01:59 +00:00
jbouwh
312ff03b5b Add subentry support for MQTT siren device 2025-10-13 19:54:10 +00:00
11 changed files with 225 additions and 211 deletions

View File

@@ -8,5 +8,5 @@
"iot_class": "local_polling",
"loggers": ["aiocomelit"],
"quality_scale": "platinum",
"requirements": ["aiocomelit==1.1.2"]
"requirements": ["aiocomelit==1.1.1"]
}

View File

@@ -138,23 +138,11 @@ class ImprovBLEConfigFlow(ConfigFlow, domain=DOMAIN):
_LOGGER.debug(
(
"Aborting improv flow, device with bluetooth address '%s' is "
"already provisioned: %s; clearing match history to allow "
"rediscovery if device is factory reset"
"already provisioned: %s"
),
self._discovery_info.address,
improv_service_data.state,
)
# Clear match history so device can be rediscovered if factory reset.
# This is safe to do on every abort because:
# 1. While device stays provisioned, the Bluetooth matcher won't trigger
# new discoveries since the advertisement content hasn't changed
# 2. If device is factory reset (state changes to authorized), the
# matcher will see new content and trigger discovery since we cleared
# the history
# 3. No ongoing monitoring or callbacks - zero performance overhead
bluetooth.async_clear_address_from_match_history(
self.hass, self._discovery_info.address
)
raise AbortFlow("already_provisioned")
@callback
@@ -192,14 +180,6 @@ class ImprovBLEConfigFlow(ConfigFlow, domain=DOMAIN):
self._abort_if_unique_id_configured()
self._abort_if_provisioned()
# Clear match history at the start of discovery flow.
# This ensures that if the user never provisions the device and it
# disappears (powers down), the discovery flow gets cleaned up,
# and then the device comes back later, it can be rediscovered.
bluetooth.async_clear_address_from_match_history(
self.hass, discovery_info.address
)
self._remove_bluetooth_callback = bluetooth.async_register_callback(
self.hass,
self._async_update_ble,
@@ -337,13 +317,6 @@ class ImprovBLEConfigFlow(ConfigFlow, domain=DOMAIN):
return
else:
_LOGGER.debug("Provision successful, redirect URL: %s", redirect_url)
# Clear match history so device can be rediscovered if factory reset.
# This ensures that if the device is factory reset in the future,
# it will trigger a new discovery flow.
assert self._discovery_info is not None
bluetooth.async_clear_address_from_match_history(
self.hass, self._discovery_info.address
)
# Abort all flows in progress with same unique ID
for flow in self._async_in_progress(include_uninitialized=True):
flow_unique_id = flow["context"].get("unique_id")

View File

@@ -150,6 +150,7 @@ from .const import (
CONF_ACTION_TOPIC,
CONF_AVAILABILITY_TEMPLATE,
CONF_AVAILABILITY_TOPIC,
CONF_AVAILABLE_TONES,
CONF_BIRTH_MESSAGE,
CONF_BLUE_TEMPLATE,
CONF_BRIGHTNESS_COMMAND_TEMPLATE,
@@ -307,6 +308,8 @@ from .const import (
CONF_STATE_VALUE_TEMPLATE,
CONF_STEP,
CONF_SUGGESTED_DISPLAY_PRECISION,
CONF_SUPPORT_DURATION,
CONF_SUPPORT_VOLUME_SET,
CONF_SUPPORTED_COLOR_MODES,
CONF_SUPPORTED_FEATURES,
CONF_SWING_HORIZONTAL_MODE_COMMAND_TEMPLATE,
@@ -460,6 +463,7 @@ SUBENTRY_PLATFORMS = [
Platform.NUMBER,
Platform.SELECT,
Platform.SENSOR,
Platform.SIREN,
Platform.SWITCH,
]
@@ -1163,6 +1167,7 @@ ENTITY_CONFIG_VALIDATOR: dict[
Platform.NOTIFY.value: None,
Platform.NUMBER.value: validate_number_platform_config,
Platform.SELECT: None,
Platform.SIREN: None,
Platform.SENSOR.value: validate_sensor_platform_config,
Platform.SWITCH.value: None,
}
@@ -1419,6 +1424,7 @@ PLATFORM_ENTITY_FIELDS: dict[str, dict[str, PlatformField]] = {
default=None,
),
},
Platform.SIREN: {},
Platform.SWITCH.value: {
CONF_DEVICE_CLASS: PlatformField(
selector=SWITCH_DEVICE_CLASS_SELECTOR, required=False
@@ -3181,6 +3187,71 @@ PLATFORM_MQTT_FIELDS: dict[str, dict[str, PlatformField]] = {
section="advanced_settings",
),
},
Platform.SIREN: {
CONF_COMMAND_TOPIC: PlatformField(
selector=TEXT_SELECTOR,
required=True,
validator=valid_publish_topic,
error="invalid_publish_topic",
),
CONF_COMMAND_TEMPLATE: PlatformField(
selector=TEMPLATE_SELECTOR,
required=False,
validator=validate(cv.template),
error="invalid_template",
),
CONF_STATE_TOPIC: PlatformField(
selector=TEXT_SELECTOR,
required=False,
validator=valid_subscribe_topic,
error="invalid_subscribe_topic",
),
CONF_VALUE_TEMPLATE: PlatformField(
selector=TEMPLATE_SELECTOR,
required=False,
validator=validate(cv.template),
error="invalid_template",
),
CONF_PAYLOAD_OFF: PlatformField(
selector=TEXT_SELECTOR,
required=False,
default=DEFAULT_PAYLOAD_OFF,
),
CONF_PAYLOAD_ON: PlatformField(
selector=TEXT_SELECTOR,
required=False,
default=DEFAULT_PAYLOAD_ON,
),
CONF_STATE_OFF: PlatformField(
selector=TEXT_SELECTOR,
required=False,
),
CONF_STATE_ON: PlatformField(
selector=TEXT_SELECTOR,
required=False,
),
CONF_AVAILABLE_TONES: PlatformField(
selector=OPTIONS_SELECTOR,
required=False,
),
CONF_SUPPORT_DURATION: PlatformField(
selector=BOOLEAN_SELECTOR,
required=False,
),
CONF_SUPPORT_VOLUME_SET: PlatformField(
selector=BOOLEAN_SELECTOR,
required=False,
),
CONF_RETAIN: PlatformField(selector=BOOLEAN_SELECTOR, required=False),
CONF_OPTIMISTIC: PlatformField(selector=BOOLEAN_SELECTOR, required=False),
CONF_COMMAND_OFF_TEMPLATE: PlatformField(
selector=TEMPLATE_SELECTOR,
required=False,
validator=validate(cv.template),
error="invalid_template",
section="siren_advanced_settings",
),
},
Platform.SWITCH.value: {
CONF_COMMAND_TOPIC: PlatformField(
selector=TEXT_SELECTOR,

View File

@@ -30,6 +30,7 @@ CONF_AVAILABILITY = "availability"
CONF_AVAILABILITY_MODE = "availability_mode"
CONF_AVAILABILITY_TEMPLATE = "availability_template"
CONF_AVAILABILITY_TOPIC = "availability_topic"
CONF_AVAILABLE_TONES = "available_tones"
CONF_BROKER = "broker"
CONF_BIRTH_MESSAGE = "birth_message"
CONF_CODE_ARM_REQUIRED = "code_arm_required"
@@ -200,6 +201,8 @@ CONF_STATE_UNLOCKED = "state_unlocked"
CONF_STATE_UNLOCKING = "state_unlocking"
CONF_STEP = "step"
CONF_SUGGESTED_DISPLAY_PRECISION = "suggested_display_precision"
CONF_SUPPORT_DURATION = "support_duration"
CONF_SUPPORT_VOLUME_SET = "support_volume_set"
CONF_SUPPORTED_COLOR_MODES = "supported_color_modes"
CONF_SWING_HORIZONTAL_MODE_COMMAND_TEMPLATE = "swing_horizontal_mode_command_template"
CONF_SWING_HORIZONTAL_MODE_COMMAND_TOPIC = "swing_horizontal_mode_command_topic"

View File

@@ -39,10 +39,18 @@ from homeassistant.util.json import JSON_DECODE_EXCEPTIONS, json_loads_object
from . import subscription
from .config import MQTT_RW_SCHEMA
from .const import (
CONF_AVAILABLE_TONES,
CONF_COMMAND_OFF_TEMPLATE,
CONF_COMMAND_TEMPLATE,
CONF_COMMAND_TOPIC,
CONF_STATE_OFF,
CONF_STATE_ON,
CONF_STATE_TOPIC,
CONF_STATE_VALUE_TEMPLATE,
CONF_SUPPORT_DURATION,
CONF_SUPPORT_VOLUME_SET,
DEFAULT_PAYLOAD_OFF,
DEFAULT_PAYLOAD_ON,
PAYLOAD_EMPTY_JSON,
PAYLOAD_NONE,
)
@@ -58,18 +66,9 @@ from .schemas import MQTT_ENTITY_COMMON_SCHEMA
PARALLEL_UPDATES = 0
DEFAULT_NAME = "MQTT Siren"
DEFAULT_PAYLOAD_ON = "ON"
DEFAULT_PAYLOAD_OFF = "OFF"
ENTITY_ID_FORMAT = siren.DOMAIN + ".{}"
CONF_AVAILABLE_TONES = "available_tones"
CONF_COMMAND_OFF_TEMPLATE = "command_off_template"
CONF_STATE_ON = "state_on"
CONF_STATE_OFF = "state_off"
CONF_SUPPORT_DURATION = "support_duration"
CONF_SUPPORT_VOLUME_SET = "support_volume_set"
STATE = "state"
PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend(

View File

@@ -153,7 +153,7 @@
},
"data_description": {
"availability_topic": "Topic to receive the availability payload on",
"availability_template": "A [template]({templating_url}#using-templates-with-the-mqtt-integration) to render the availability payload received on the availability topic",
"availability_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to render the availability payload received on the availability topic",
"payload_available": "The payload that indicates the device is available (defaults to 'online')",
"payload_not_available": "The payload that indicates the device is not available (defaults to 'offline')"
}
@@ -221,7 +221,7 @@
},
"data_description": {
"platform": "The type of the entity to configure.",
"name": "The name of the entity. Leave empty to set it to `None` to [mark it as main feature of the MQTT device]({naming_entities_url).",
"name": "The name of the entity. Leave empty to set it to `None` to [mark it as main feature of the MQTT device](https://www.home-assistant.io/integrations/mqtt/#naming-of-mqtt-entities).",
"entity_picture": "An URL to a picture to be assigned."
}
},
@@ -288,7 +288,7 @@
"climate_feature_target_temperature": "The climate supports setting the target temperature.",
"climate_feature_target_humidity": "The climate supports setting the target humidity.",
"device_class": "The device class of the {platform} entity. [Learn more.]({url}#device_class)",
"entity_category": "Allows marking an entity as device configuration or diagnostics. An entity with a category will not be exposed to cloud, Alexa, or Google Assistant components, nor included in indirect action calls to devices or areas. Sensor entities cannot be assigned a device configuration class. [Learn more.]({registry_properties_url)",
"entity_category": "Allows marking an entity as device configuration or diagnostics. An entity with a category will not be exposed to cloud, Alexa, or Google Assistant components, nor included in indirect action calls to devices or areas. Sensor entities cannot be assigned a device configuration class. [Learn more.](https://developers.home-assistant.io/docs/core/entity/#registry-properties)",
"fan_feature_speed": "The fan supports multiple speeds.",
"fan_feature_preset_modes": "The fan supports preset modes.",
"fan_feature_oscillation": "The fan supports oscillation.",
@@ -296,7 +296,7 @@
"image_processing_mode": "Select how the image data is received.",
"options": "Options for allowed sensor state values. The sensors Device class must be set to Enumeration. The 'Options' setting cannot be used together with State class or Unit of measurement.",
"schema": "The schema to use. [Learn more.]({url}#comparison-of-light-mqtt-schemas)",
"state_class": "The [State class]({available_state_classes_url}) of the sensor. [Learn more.]({url}#state_class)",
"state_class": "The [State class](https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes) of the sensor. [Learn more.]({url}#state_class)",
"suggested_display_precision": "The number of decimals which should be used in the {platform} entity state after rounding. [Learn more.]({url}#suggested_display_precision)",
"supported_features": "The features that the entity supports.",
"temperature_unit": "This determines the native unit of measurement the MQTT climate device works with.",
@@ -318,6 +318,7 @@
"title": "Configure MQTT device \"{mqtt_device}\"",
"description": "Please configure MQTT specific details for {platform} entity \"{entity}\":",
"data": {
"available_tones": "Available Tones",
"blue_template": "Blue template",
"brightness_template": "Brightness template",
"code": "Alarm code",
@@ -360,38 +361,41 @@
"state_topic": "State topic",
"state_value_template": "State value template",
"step": "Step",
"support_duration": "Duration support",
"support_volume_set": "Set volume support",
"supported_color_modes": "Supported color modes",
"url_template": "URL template",
"url_topic": "URL topic",
"value_template": "Value template"
},
"data_description": {
"blue_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract blue color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"brightness_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract brightness from the state payload value. Expected result of the template is an integer from 0-255 range.",
"available_tones": "The siren supports tones. The `tone` variable will become available for use in the \"Command template\" setting. [Learn more.]({url}#available_tones)",
"blue_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract blue color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"brightness_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract brightness from the state payload value. Expected result of the template is an integer from 0-255 range.",
"code": "Specifies a code to enable or disable the alarm in the frontend. Note that this blocks sending MQTT message commands to the remote device if the code validation fails. [Learn more.]({url}#code)",
"code_format": "A regular expression to validate a supplied code when it is set during the action to open, lock or unlock the MQTT lock. [Learn more.]({url}#code_format)",
"code_arm_required": "If set, the code is required to arm the alarm. If not set, the code is not validated.",
"code_disarm_required": "If set, the code is required to disarm the alarm. If not set, the code is not validated.",
"code_trigger_required": "If set, the code is required to manually trigger the alarm. If not set, the code is not validated.",
"color_temp_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract color temperature in Kelvin from the state payload value. Expected result of the template is an integer.",
"command_off_template": "The [template]({templating_url}#using-command-templates-with-mqtt) for \"off\" state changes. Available variables are: `state` and `transition`.",
"command_on_template": "The [template]({templating_url}#using-command-templates-with-mqtt) for \"on\" state changes. Available variables: `state`, `brightness`, `color_temp`, `red`, `green`, `blue`, `hue`, `sat`, `flash`, `transition` and `effect`. Values `red`, `green`, `blue` and `brightness` are provided as integers from range 0-255. Value of `hue` is provided as float from range 0-360. Value of `sat` is provided as float from range 0-100. Value of `color_temp` is provided as integer representing Kelvin units.",
"command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to render the payload to be published at the command topic. [Learn more.]({url}#command_template)",
"color_temp_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract color temperature in Kelvin from the state payload value. Expected result of the template is an integer.",
"command_off_template": "The [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) for \"off\" state changes. Available variables are: `state` and `transition`.",
"command_on_template": "The [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) for \"on\" state changes. Available variables: `state`, `brightness`, `color_temp`, `red`, `green`, `blue`, `hue`, `sat`, `flash`, `transition` and `effect`. Values `red`, `green`, `blue` and `brightness` are provided as integers from range 0-255. Value of `hue` is provided as float from range 0-360. Value of `sat` is provided as float from range 0-100. Value of `color_temp` is provided as integer representing Kelvin units.",
"command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to render the payload to be published at the command topic. [Learn more.]({url}#command_template)",
"command_topic": "The publishing topic that will be used to control the {platform} entity. [Learn more.]({url}#command_topic)",
"content_type": "The content type or the image data that is received at the image topic.",
"force_update": "Sends update events even if the value hasnt changed. Useful if you want to have meaningful value graphs in history. [Learn more.]({url}#force_update)",
"green_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract green color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"green_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract green color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"image_encoding": "Select the encoding of the received image data",
"image_topic": "The MQTT topic subscribed to receive messages containing the image data. [Learn more.]({url}#image_topic)",
"last_reset_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the last reset. When Last reset template is set, the State class option must be Total. [Learn more.]({url}#last_reset_value_template)",
"last_reset_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the last reset. When Last reset template is set, the State class option must be Total. [Learn more.]({url}#last_reset_value_template)",
"max": "Maximum value. [Learn more.]({url}#max)",
"min": "Minimum value. [Learn more.]({url}#min)",
"mode": "Control how the number should be displayed in the UI. [Learn more.]({url}#mode)",
"modes": "A list of supported operation modes. [Learn more.]({url}#modes)",
"mode_command_topic": "The MQTT topic to publish commands to change the climate operation mode. [Learn more.]({url}#mode_command_topic)",
"mode_command_template": "[Template]({templating_url}#using-command-templates-with-mqtt) to define the operation mode to be sent to the operation mode command topic. [Learn more.]({url}#mode_command_template)",
"mode_command_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to define the operation mode to be sent to the operation mode command topic. [Learn more.]({url}#mode_command_template)",
"mode_state_topic": "The MQTT topic subscribed to receive operation mode state messages. [Learn more.]({url}#mode_state_topic)",
"mode_state_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the operation mode state. [Learn more.]({url}#mode_state_template)",
"mode_state_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the operation mode state. [Learn more.]({url}#mode_state_template)",
"on_command_type": "Defines when the payload \"on\" is sent. Using \"Last\" (the default) will send any style (brightness, color, etc) topics first and then a payload \"on\" to the command topic. Using \"First\" will send the payload \"on\" and then any style topics. Using \"Brightness\" will only send brightness commands instead of the payload \"on\" to turn the light on.",
"optimistic": "Flag that defines if the {platform} entity works in optimistic mode. [Learn more.]({url}#optimistic)",
"options": "List of options that can be selected.",
@@ -400,17 +404,19 @@
"payload_press": "The payload to send when the button is triggered.",
"payload_reset": "The payload received at the state topic that resets the entity to an unknown state.",
"qos": "The QoS value a {platform} entity should use.",
"red_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract red color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"red_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract red color from the state payload value. Expected result of the template is an integer from 0-255 range.",
"retain": "Select if values published by the {platform} entity should be retained at the MQTT broker.",
"state_off": "The incoming payload that represents the \"off\" state. Use only when the value that represents \"off\" state in the state topic is different from value that should be sent to the command topic to turn the device off.",
"state_on": "The incoming payload that represents the \"on\" state. Use only when the value that represents \"on\" state in the state topic is different from value that should be sent to the command topic to turn the device on.",
"state_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract state from the state payload value.",
"state_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract state from the state payload value.",
"state_topic": "The MQTT topic subscribed to receive {platform} state values. [Learn more.]({url}#state_topic)",
"step": "Step value. Smallest value 0.001.",
"support_duration": "The siren supports setting a duration in second. The `duration` variable will become available for use in the \"Command template\" setting. [Learn more.]({url}#support_duration)",
"support_volume_set": "The siren supports setting a volume. The `tone` variable will become available for use in the \"Command template\" setting. [Learn more.]({url}#support_volume_set)",
"supported_color_modes": "A list of color modes supported by the light. Possible color modes are On/Off, Brightness, Color temperature, HS, XY, RGB, RGBW, RGBWW, White. Note that if On/Off or Brightness are used, that must be the only value in the list. [Learn more.]({url}#supported_color_modes)",
"url_template": "[Template]({templating_url}#using-value-templates-with-mqtt) to extract an URL from the received URL topic payload value. [Learn more.]({url}#url_template)",
"url_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract an URL from the received URL topic payload value. [Learn more.]({url}#url_template)",
"url_topic": "The MQTT topic subscribed to receive messages containing the image URL. [Learn more.]({url}#url_topic)",
"value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the {platform} entity value. [Learn more.]({url}#value_template)"
"value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the {platform} entity value. [Learn more.]({url}#value_template)"
},
"sections": {
"advanced_settings": {
@@ -464,7 +470,7 @@
"action_topic": "Action topic"
},
"data_description": {
"action_template": "A [template]({templating_url}#using-value-templates-with-mqtt) to render the value received on the action topic with.",
"action_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to render the value received on the action topic with.",
"action_topic": "The MQTT topic to subscribe for changes of the current action. If this is set, the climate graph uses the value received as data source. A \"None\" payload resets the current action state. An empty payload is ignored. Valid action values are: \"off\", \"heating\", \"cooling\", \"drying\", \"idle\" and \"fan\". [Learn more.]({url}#action_topic)"
}
},
@@ -480,9 +486,9 @@
"data_description": {
"fan_modes": "List of fan modes this climate is capable of running at. Common fan modes that offer translations are `off`, `on`, `auto`, `low`, `medium`, `high`, `middle`, `focus` and `diffuse`.",
"fan_mode_command_topic": "The MQTT topic to publish commands to change the climate fan mode. [Learn more.]({url}#fan_mode_command_topic)",
"fan_mode_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the fan mode command topic.",
"fan_mode_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the fan mode command topic.",
"fan_mode_state_topic": "The MQTT topic subscribed to receive the climate fan mode. [Learn more.]({url}#fan_mode_state_topic)",
"fan_mode_state_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the climate fan mode value."
"fan_mode_state_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the climate fan mode value."
}
},
"climate_power_settings": {
@@ -496,7 +502,7 @@
"data_description": {
"payload_off": "[%key:component::mqtt::config_subentries::device::step::mqtt_platform_config::data_description::payload_off%]",
"payload_on": "[%key:component::mqtt::config_subentries::device::step::mqtt_platform_config::data_description::payload_on%]",
"power_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the power command topic. The `value` parameter is the payload set for payload \"on\" or payload \"off\".",
"power_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the power command topic. The `value` parameter is the payload set for payload \"on\" or payload \"off\".",
"power_command_topic": "The MQTT topic to publish commands to change the climate power state. Sends the payload configured with payload \"on\" or payload \"off\". [Learn more.]({url}#power_command_topic)"
}
},
@@ -529,9 +535,9 @@
"data_description": {
"swing_horizontal_modes": "List of horizontal swing modes this climate is capable of running at. Common horizontal swing modes that offer translations are `off` and `on`.",
"swing_horizontal_mode_command_topic": "The MQTT topic to publish commands to change the climate horizontal swing mode. [Learn more.]({url}#swing_horizontal_mode_command_topic)",
"swing_horizontal_mode_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the horizontal swing mode command topic.",
"swing_horizontal_mode_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the horizontal swing mode command topic.",
"swing_horizontal_mode_state_topic": "The MQTT topic subscribed to receive the climate horizontal swing mode. [Learn more.]({url}#swing_horizontal_mode_state_topic)",
"swing_horizontal_mode_state_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the climate horizontal swing mode value."
"swing_horizontal_mode_state_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the climate horizontal swing mode value."
}
},
"climate_swing_mode_settings": {
@@ -546,9 +552,9 @@
"data_description": {
"swing_modes": "List of swing modes this climate is capable of running at. Common swing modes that offer translations are `off`, `on`, `vertical`, `horizontal` and `both`.",
"swing_mode_command_topic": "The MQTT topic to publish commands to change the climate swing mode. [Learn more.]({url}#swing_mode_command_topic)",
"swing_mode_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the swing mode command topic.",
"swing_mode_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the swing mode command topic.",
"swing_mode_state_topic": "The MQTT topic subscribed to receive the climate swing mode. [Learn more.]({url}#swing_mode_state_topic)",
"swing_mode_state_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the climate swing mode value."
"swing_mode_state_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the climate swing mode value."
}
},
"cover_payload_settings": {
@@ -589,9 +595,9 @@
"data_description": {
"position_closed": "Number which represents \"closed\" position.",
"position_open": "Number which represents \"open\" position.",
"position_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the payload for the position topic. Within the template the following variables are also available: `entity_id`, `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#position_template)",
"position_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the payload for the position topic. Within the template the following variables are also available: `entity_id`, `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#position_template)",
"position_topic": "The MQTT topic subscribed to receive cover position state messages. [Learn more.]({url}#position_topic)",
"set_position_template": "[Template]({templating_url}#using-command-templates-with-mqtt) to define the position to be sent to the set position topic. Within the template the following variables are available: `value` (the scaled target position), `entity_id`, `position` (the target position percentage), `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#set_position_template)",
"set_position_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to define the position to be sent to the set position topic. Within the template the following variables are available: `value` (the scaled target position), `entity_id`, `position` (the target position percentage), `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#set_position_template)",
"set_position_topic": "The MQTT topic to publish position commands to. You need to use the set position topic as well if you want to use the position topic. Use template if position topic wants different values than within range \"position closed\" - \"position_open\". If template is not defined and position \"closed\" != 100 and position \"open\" != 0 then proper position value is calculated from percentage position. [Learn more.]({url}#set_position_topic)"
}
},
@@ -610,12 +616,12 @@
},
"data_description": {
"tilt_closed_value": "The value that will be sent to the \"tilt command topic\" when the cover tilt is closed.",
"tilt_command_template": "[Template]({templating_url}#using-command-templates-with-mqtt) to define the position to be sent to the tilt command topic. Within the template the following variables are available: `entity_id`, `tilt_position` (the target tilt position percentage), `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#tilt_command_template)",
"tilt_command_template": "[Template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to define the position to be sent to the tilt command topic. Within the template the following variables are available: `entity_id`, `tilt_position` (the target tilt position percentage), `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#tilt_command_template)",
"tilt_command_topic": "The MQTT topic to publish commands to control the cover tilt. [Learn more.]({url}#tilt_command_topic)",
"tilt_max": "The maximum tilt value.",
"tilt_min": "The minimum tilt value.",
"tilt_opened_value": "The value that will be sent to the \"tilt command topic\" when the cover tilt is opened.",
"tilt_status_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the payload for the tilt status topic. Within the template the following variables are available: `entity_id`, `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#tilt_status_template)",
"tilt_status_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the payload for the tilt status topic. Within the template the following variables are available: `entity_id`, `position_open`, `position_closed`, `tilt_min` and `tilt_max`. [Learn more.]({url}#tilt_status_template)",
"tilt_status_topic": "The MQTT topic subscribed to receive tilt status update values. [Learn more.]({url}#tilt_status_topic)",
"tilt_optimistic": "Flag that defines if tilt works in optimistic mode. If tilt status topic is not defined, tilt works in optimistic mode by default. [Learn more.]({url}#tilt_optimistic)"
}
@@ -627,7 +633,7 @@
"current_humidity_topic": "Current humidity topic"
},
"data_description": {
"current_humidity_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the current humidity value. [Learn more.]({url}#current_humidity_template)",
"current_humidity_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the current humidity value. [Learn more.]({url}#current_humidity_template)",
"current_humidity_topic": "The MQTT topic subscribed to receive current humidity update values. [Learn more.]({url}#current_humidity_topic)"
}
},
@@ -638,7 +644,7 @@
"current_temperature_topic": "Current temperature topic"
},
"data_description": {
"current_temperature_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the current temperature value. [Learn more.]({url}#current_temperature_template)",
"current_temperature_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the current temperature value. [Learn more.]({url}#current_temperature_template)",
"current_temperature_topic": "The MQTT topic subscribed to receive current temperature update values. [Learn more.]({url}#current_temperature_topic)"
}
},
@@ -654,11 +660,11 @@
},
"data_description": {
"brightness": "Flag that defines if light supports brightness when the RGB, RGBW, or RGBWW color mode is supported.",
"brightness_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the brightness command topic.",
"brightness_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the brightness command topic.",
"brightness_command_topic": "The publishing topic that will be used to control the brightness. [Learn more.]({url}#brightness_command_topic)",
"brightness_scale": "Defines the maximum brightness value (i.e., 100%) of the maximum brightness.",
"brightness_state_topic": "The MQTT topic subscribed to receive brightness state values. [Learn more.]({url}#brightness_state_topic)",
"brightness_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the brightness value."
"brightness_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the brightness value."
}
},
"lock_payload_settings": {
@@ -696,9 +702,9 @@
},
"data_description": {
"direction_command_topic": "The MQTT topic to publish commands to change the fan direction. The payload will be either `forward` or `reverse` and can be customized using the direction command template. [Learn more.]({url}#direction_command_topic)",
"direction_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the direction command topic. The template variable `value` will be either `forward` or `reverse`.",
"direction_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the direction command topic. The template variable `value` will be either `forward` or `reverse`.",
"direction_state_topic": "The MQTT topic subscribed to receive fan direction state. Accepted state payloads are `forward` or `reverse`. [Learn more.]({url}#direction_state_topic)",
"direction_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract fan direction state value. The template should return either `forward` or `reverse`. When the template returns an empty string, the direction will be ignored."
"direction_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract fan direction state value. The template should return either `forward` or `reverse`. When the template returns an empty string, the direction will be ignored."
}
},
"fan_oscillation_settings": {
@@ -713,9 +719,9 @@
},
"data_description": {
"oscillation_command_topic": "The MQTT topic to publish commands to change the fan oscillation state. [Learn more.]({url}#oscillation_command_topic)",
"oscillation_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the oscillation command topic.",
"oscillation_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the oscillation command topic.",
"oscillation_state_topic": "The MQTT topic subscribed to receive fan oscillation state. [Learn more.]({url}#oscillation_state_topic)",
"oscillation_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract fan oscillation state value.",
"oscillation_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract fan oscillation state value.",
"payload_oscillation_off": "The payload that represents the oscillation \"off\" state.",
"payload_oscillation_on": "The payload that represents the oscillation \"on\" state."
}
@@ -734,9 +740,9 @@
"payload_reset_preset_mode": "A special payload that resets the fan preset mode state attribute to unknown when received at the preset mode state topic.",
"preset_modes": "List of preset modes this fan is capable of running at. Common examples include auto, smart, whoosh, eco and breeze.",
"preset_mode_command_topic": "The MQTT topic to publish commands to change the fan preset mode. [Learn more.]({url}#preset_mode_command_topic)",
"preset_mode_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the preset mode command topic.",
"preset_mode_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the preset mode command topic.",
"preset_mode_state_topic": "The MQTT topic subscribed to receive fan preset mode. [Learn more.]({url}#preset_mode_state_topic)",
"preset_mode_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract fan preset mode value."
"preset_mode_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract fan preset mode value."
}
},
"fan_speed_settings": {
@@ -753,9 +759,9 @@
"data_description": {
"payload_reset_percentage": "A special payload that resets the fan speed percentage state attribute to unknown when received at the percentage state topic.",
"percentage_command_topic": "The MQTT topic to publish commands to change the fan speed state based on a percentage. [Learn more.]({url}#percentage_command_topic)",
"percentage_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the percentage command topic.",
"percentage_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the percentage command topic.",
"percentage_state_topic": "The MQTT topic subscribed to receive fan speed based on percentage. [Learn more.]({url}#percentage_state_topic)",
"percentage_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the speed percentage value.",
"percentage_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the speed percentage value.",
"speed_range_min": "The minimum of numeric output range (off not included, so speed_range_min - 1 represents 0 %). The percentage step is 100 / the number of speeds within the \"speed range\".",
"speed_range_max": "The maximum of numeric output range (representing 100 %). The percentage step is 100 / number of speeds within the \"speed range\"."
}
@@ -768,7 +774,7 @@
},
"data_description": {
"color_mode_state_topic": "The MQTT topic subscribed to receive color mode updates. If this is not configured, the color mode will be automatically set according to the last received valid color or color temperature.",
"color_mode_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the color mode value."
"color_mode_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the color mode value."
}
},
"light_color_temp_settings": {
@@ -780,10 +786,10 @@
"color_temp_value_template": "Color temperature value template"
},
"data_description": {
"color_temp_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the color temperature command topic.",
"color_temp_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the color temperature command topic.",
"color_temp_command_topic": "The publishing topic that will be used to control the color temperature. [Learn more.]({url}#color_temp_command_topic)",
"color_temp_state_topic": "The MQTT topic subscribed to receive color temperature state updates. [Learn more.]({url}#color_temp_state_topic)",
"color_temp_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the color temperature value."
"color_temp_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the color temperature value."
}
},
"light_effect_settings": {
@@ -799,7 +805,7 @@
},
"data_description": {
"effect": "Flag that defines if the light supports effects.",
"effect_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the effect command topic.",
"effect_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the effect command topic.",
"effect_command_topic": "The publishing topic that will be used to control the light's effect state. [Learn more.]({url}#effect_command_topic)",
"effect_list": "The list of effects the light supports.",
"effect_state_topic": "The MQTT topic subscribed to receive effect state updates. [Learn more.]({url}#effect_state_topic)"
@@ -814,10 +820,10 @@
"hs_value_template": "HS value template"
},
"data_description": {
"hs_command_template": "Defines a [template]({templating_url}#using-command-templates-with-mqtt) to compose message which will be sent to HS command topic. Available variables: `hue` and `sat`.",
"hs_command_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose message which will be sent to HS command topic. Available variables: `hue` and `sat`.",
"hs_command_topic": "The MQTT topic to publish commands to change the lights color state in HS format (Hue Saturation). Range for Hue: 0° .. 360°, Range of Saturation: 0..100. Note: Brightness is sent separately in the brightness command topic. [Learn more.]({url}#hs_command_topic)",
"hs_state_topic": "The MQTT topic subscribed to receive color state updates in HS format. The expected payload is the hue and saturation values separated by commas, for example, `359.5,100.0`. Note: Brightness is received separately in the brightness state topic. [Learn more.]({url}#hs_state_topic)",
"hs_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the HS value."
"hs_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the HS value."
}
},
"light_rgb_settings": {
@@ -829,10 +835,10 @@
"rgb_value_template": "RGB value template"
},
"data_description": {
"rgb_command_template": "Defines a [template]({templating_url}#using-command-templates-with-mqtt) to compose message which will be sent to RGB command topic. Available variables: `red`, `green` and `blue`.",
"rgb_command_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose message which will be sent to RGB command topic. Available variables: `red`, `green` and `blue`.",
"rgb_command_topic": "The MQTT topic to publish commands to change the lights RGB state. [Learn more.]({url}#rgb_command_topic)",
"rgb_state_topic": "The MQTT topic subscribed to receive RGB state updates. The expected payload is the RGB values separated by commas, for example, `255,0,127`. [Learn more.]({url}#rgb_state_topic)",
"rgb_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the RGB value."
"rgb_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the RGB value."
}
},
"light_rgbw_settings": {
@@ -844,10 +850,10 @@
"rgbw_value_template": "RGBW value template"
},
"data_description": {
"rgbw_command_template": "Defines a [template]({templating_url}#using-command-templates-with-mqtt) to compose message which will be sent to RGBW command topic. Available variables: `red`, `green`, `blue` and `white`.",
"rgbw_command_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose message which will be sent to RGBW command topic. Available variables: `red`, `green`, `blue` and `white`.",
"rgbw_command_topic": "The MQTT topic to publish commands to change the lights RGBW state. [Learn more.]({url}#rgbw_command_topic)",
"rgbw_state_topic": "The MQTT topic subscribed to receive RGBW state updates. The expected payload is the RGBW values separated by commas, for example, `255,0,127,64`. [Learn more.]({url}#rgbw_state_topic)",
"rgbw_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the RGBW value."
"rgbw_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the RGBW value."
}
},
"light_rgbww_settings": {
@@ -859,10 +865,10 @@
"rgbww_value_template": "RGBWW value template"
},
"data_description": {
"rgbww_command_template": "Defines a [template]({templating_url}#using-command-templates-with-mqtt) to compose message which will be sent to RGBWW command topic. Available variables: `red`, `green`, `blue`, `cold_white` and `warm_white`.",
"rgbww_command_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose message which will be sent to RGBWW command topic. Available variables: `red`, `green`, `blue`, `cold_white` and `warm_white`.",
"rgbww_command_topic": "The MQTT topic to publish commands to change the lights RGBWW state. [Learn more.]({url}#rgbww_command_topic)",
"rgbww_state_topic": "The MQTT topic subscribed to receive RGBWW state updates. The expected payload is the RGBWW values separated by commas, for example, `255,0,127,64,32`. [Learn more.]({url}#rgbww_state_topic)",
"rgbww_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the RGBWW value."
"rgbww_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the RGBWW value."
}
},
"light_white_settings": {
@@ -885,10 +891,10 @@
"xy_value_template": "XY value template"
},
"data_description": {
"xy_command_template": "Defines a [template]({templating_url}#using-command-templates-with-mqtt) to compose message which will be sent to XY command topic. Available variables: `x` and `y`.",
"xy_command_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose message which will be sent to XY command topic. Available variables: `x` and `y`.",
"xy_command_topic": "The MQTT topic to publish commands to change the lights XY state. [Learn more.]({url}#xy_command_topic)",
"xy_state_topic": "The MQTT topic subscribed to receive XY state updates. The expected payload is the X and Y color values separated by commas, for example, `0.675,0.322`. [Learn more.]({url}#xy_state_topic)",
"xy_value_template": "Defines a [template]({templating_url}#using-value-templates-with-mqtt) to extract the XY value."
"xy_value_template": "Defines a [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to extract the XY value."
}
},
"target_humidity_settings": {
@@ -904,12 +910,21 @@
"data_description": {
"max_humidity": "The maximum target humidity that can be set.",
"min_humidity": "The minimum target humidity that can be set.",
"target_humidity_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the target humidity command topic.",
"target_humidity_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the target humidity command topic.",
"target_humidity_command_topic": "The MQTT topic to publish commands to change the climate target humidity. [Learn more.]({url}#humidity_command_topic)",
"target_humidity_state_template": "A [template]({templating_url}#using-value-templates-with-mqtt) to render the value received on the target humidity state topic with.",
"target_humidity_state_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to render the value received on the target humidity state topic with.",
"target_humidity_state_topic": "The MQTT topic to subscribe for changes of the target humidity. [Learn more.]({url}#humidity_state_topic)"
}
},
"siren_advanced_settings": {
"name": "Advanced siren settings",
"data": {
"command_off_template": "Command \"off\" template"
},
"data_description": {
"command_off_template": "The [template]({templating_url}#using-command-templates-with-mqtt) for \"off\" state changes. By default the \"[Command template]({url}#command_template)\" will be used. [Learn more.]({url}#command_off_template)"
}
},
"target_temperature_settings": {
"name": "Target temperature settings",
"data": {
@@ -937,17 +952,17 @@
"min_temp": "The minimum target temperature that can be set.",
"precision": "The precision in degrees the thermostat is working at.",
"temp_step": "The target temperature step in degrees Celsius or Fahrenheit.",
"temperature_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the temperature command topic.",
"temperature_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the temperature command topic.",
"temperature_command_topic": "The MQTT topic to publish commands to change the climate target temperature. [Learn more.]({url}#temperature_command_topic)",
"temperature_high_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the upper temperature command topic.",
"temperature_high_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the upper temperature command topic.",
"temperature_high_command_topic": "The MQTT topic to publish commands to change the climate upper target temperature. [Learn more.]({url}#temperature_high_command_topic)",
"temperature_low_command_template": "A [template]({templating_url}#using-command-templates-with-mqtt) to compose the payload to be published at the lower temperature command topic.",
"temperature_low_command_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-command-templates-with-mqtt) to compose the payload to be published at the lower temperature command topic.",
"temperature_low_command_topic": "The MQTT topic to publish commands to change the climate lower target temperature. [Learn more.]({url}#temperature_low_command_topic)",
"temperature_state_template": "A [template]({templating_url}#using-value-templates-with-mqtt) to render the value received on the temperature state topic with.",
"temperature_state_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to render the value received on the temperature state topic with.",
"temperature_state_topic": "The MQTT topic to subscribe for changes of the target temperature. [Learn more.]({url}#temperature_state_topic)",
"temperature_high_state_template": "A [template]({templating_url}#using-value-templates-with-mqtt) to render the value received on the upper temperature state topic with.",
"temperature_high_state_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to render the value received on the upper temperature state topic with.",
"temperature_high_state_topic": "The MQTT topic to subscribe for changes of the upper target temperature. [Learn more.]({url}#temperature_high_state_topic)",
"temperature_low_state_template": "A [template]({templating_url}#using-value-templates-with-mqtt) to render the value received on the lower temperature state topic with.",
"temperature_low_state_template": "A [template](https://www.home-assistant.io/docs/configuration/templating/#using-value-templates-with-mqtt) to render the value received on the lower temperature state topic with.",
"temperature_low_state_topic": "The MQTT topic to subscribe for changes of the lower target temperature. [Learn more.]({url}#temperature_low_state_topic)"
}
}
@@ -1338,6 +1353,7 @@
"number": "[%key:component::number::title%]",
"select": "[%key:component::select::title%]",
"sensor": "[%key:component::sensor::title%]",
"siren": "[%key:component::siren::title%]",
"switch": "[%key:component::switch::title%]"
}
},

2
requirements_all.txt generated
View File

@@ -220,7 +220,7 @@ aiobafi6==0.9.0
aiobotocore==2.21.1
# homeassistant.components.comelit
aiocomelit==1.1.2
aiocomelit==1.1.1
# homeassistant.components.dhcp
aiodhcpwatcher==1.2.1

View File

@@ -208,7 +208,7 @@ aiobafi6==0.9.0
aiobotocore==2.21.1
# homeassistant.components.comelit
aiocomelit==1.1.2
aiocomelit==1.1.1
# homeassistant.components.dhcp
aiodhcpwatcher==1.2.1

View File

@@ -23,7 +23,6 @@ from . import (
)
from tests.common import MockConfigEntry
from tests.components.bluetooth import inject_bluetooth_service_info_bleak
IMPROV_BLE = "homeassistant.components.improv_ble"
@@ -180,112 +179,6 @@ async def test_bluetooth_step_provisioned_device_2(hass: HomeAssistant) -> None:
assert len(hass.config_entries.flow.async_progress_by_handler("improv_ble")) == 0
async def test_bluetooth_step_provisioned_no_rediscovery(hass: HomeAssistant) -> None:
"""Test that provisioned device is not rediscovered while it stays provisioned."""
# Step 1: Inject provisioned device advertisement (triggers discovery, aborts)
inject_bluetooth_service_info_bleak(hass, PROVISIONED_IMPROV_BLE_DISCOVERY_INFO)
await hass.async_block_till_done()
# Verify flow was aborted
flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN)
assert len(flows) == 0
# Step 2: Inject same provisioned advertisement again
# This should NOT trigger a new discovery because the content hasn't changed
# even though we cleared the match history
inject_bluetooth_service_info_bleak(hass, PROVISIONED_IMPROV_BLE_DISCOVERY_INFO)
await hass.async_block_till_done()
# Verify no new flow was started
flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN)
assert len(flows) == 0
async def test_bluetooth_step_factory_reset_rediscovery(hass: HomeAssistant) -> None:
"""Test that factory reset device can be rediscovered."""
# Start a flow manually with provisioned device to ensure improv_ble is loaded
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_BLUETOOTH},
data=PROVISIONED_IMPROV_BLE_DISCOVERY_INFO,
)
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "already_provisioned"
# Now the match history has been cleared by the config flow
# Inject authorized device advertisement - should trigger new discovery
inject_bluetooth_service_info_bleak(hass, IMPROV_BLE_DISCOVERY_INFO)
await hass.async_block_till_done()
# Verify discovery proceeds (new flow started)
flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN)
assert len(flows) == 1
assert flows[0]["step_id"] == "bluetooth_confirm"
async def test_bluetooth_rediscovery_after_successful_provision(
hass: HomeAssistant,
) -> None:
"""Test that device can be rediscovered after successful provisioning."""
# Start provisioning flow
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_BLUETOOTH},
data=IMPROV_BLE_DISCOVERY_INFO,
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "bluetooth_confirm"
# Confirm bluetooth setup
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "bluetooth_confirm"
# Start provisioning
with patch(
f"{IMPROV_BLE}.config_flow.ImprovBLEClient.can_identify", return_value=False
):
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
{CONF_ADDRESS: IMPROV_BLE_DISCOVERY_INFO.address},
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "provision"
# Complete provisioning successfully
with (
patch(
f"{IMPROV_BLE}.config_flow.ImprovBLEClient.need_authorization",
return_value=False,
),
patch(
f"{IMPROV_BLE}.config_flow.ImprovBLEClient.provision",
return_value=None,
),
):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], {"ssid": "TestNetwork", "password": "secret"}
)
assert result["type"] is FlowResultType.SHOW_PROGRESS
assert result["progress_action"] == "provisioning"
assert result["step_id"] == "do_provision"
await hass.async_block_till_done()
result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "provision_successful"
# Now inject the same device again (simulating factory reset)
# The match history was cleared after successful provision, so it should be rediscovered
inject_bluetooth_service_info_bleak(hass, IMPROV_BLE_DISCOVERY_INFO)
await hass.async_block_till_done()
# Verify new discovery flow was created
flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN)
assert len(flows) == 1
assert flows[0]["step_id"] == "bluetooth_confirm"
async def test_bluetooth_step_success(hass: HomeAssistant) -> None:
"""Test bluetooth step success path."""
result = await hass.config_entries.flow.async_init(

View File

@@ -565,6 +565,25 @@ MOCK_SUBENTRY_SENSOR_COMPONENT_LAST_RESET = {
"entity_picture": "https://example.com/e9261f6feed443e7b7d5f3fbe2a47412",
},
}
MOCK_SUBENTRY_SIREN_COMPONENT = {
"3faf1318023c46c5aea26707eeb6f12e": {
"platform": "siren",
"name": "Siren",
"entity_category": None,
"command_topic": "test-topic",
"state_topic": "test-topic",
"command_template": "{{ value }}",
"command_off_template": "{{ value }}",
"value_template": "{{ value_json.value }}",
"payload_off": "OFF",
"payload_on": "ON",
"available_tones": ["Happy hour", "Cooling alarm"],
"support_volume_set": True,
"support_duration": True,
"entity_picture": "https://example.com/3faf1318023c46c5aea26707eeb6f12e",
"optimistic": True,
},
}
MOCK_SUBENTRY_SWITCH_COMPONENT = {
"3faf1318016c46c5aea26707eeb6f12e": {
"platform": "switch",
@@ -698,6 +717,10 @@ MOCK_SENSOR_SUBENTRY_DATA_LAST_RESET_TEMPLATE = {
"device": MOCK_SUBENTRY_DEVICE_DATA | {"mqtt_settings": {"qos": 0}},
"components": MOCK_SUBENTRY_SENSOR_COMPONENT_LAST_RESET,
}
MOCK_SIREN_SUBENTRY_DATA = {
"device": MOCK_SUBENTRY_DEVICE_DATA | {"mqtt_settings": {"qos": 0}},
"components": MOCK_SUBENTRY_SIREN_COMPONENT,
}
MOCK_SWITCH_SUBENTRY_DATA = {
"device": MOCK_SUBENTRY_DEVICE_DATA | {"mqtt_settings": {"qos": 0}},
"components": MOCK_SUBENTRY_SWITCH_COMPONENT,

View File

@@ -60,6 +60,7 @@ from .common import (
MOCK_SENSOR_SUBENTRY_DATA,
MOCK_SENSOR_SUBENTRY_DATA_LAST_RESET_TEMPLATE,
MOCK_SENSOR_SUBENTRY_DATA_STATE_CLASS,
MOCK_SIREN_SUBENTRY_DATA,
MOCK_SWITCH_SUBENTRY_DATA,
)
@@ -3655,6 +3656,41 @@ async def test_migrate_of_incompatible_config_entry(
"Milk notifier Energy",
id="sensor_total",
),
pytest.param(
MOCK_SIREN_SUBENTRY_DATA,
{"name": "Milk notifier", "mqtt_settings": {"qos": 0}},
{"name": "Siren"},
{},
(),
{
"command_topic": "test-topic",
"command_template": "{{ value }}",
"state_topic": "test-topic",
"value_template": "{{ value_json.value }}",
"optimistic": True,
"available_tones": ["Happy hour", "Cooling alarm"],
"support_duration": True,
"support_volume_set": True,
"siren_advanced_settings": {
"command_off_template": "{{ value }}",
},
},
(
(
{"command_topic": "test-topic#invalid"},
{"command_topic": "invalid_publish_topic"},
),
(
{
"command_topic": "test-topic",
"state_topic": "test-topic#invalid",
},
{"state_topic": "invalid_subscribe_topic"},
),
),
"Milk notifier Siren",
id="siren",
),
pytest.param(
MOCK_SWITCH_SUBENTRY_DATA,
{"name": "Milk notifier", "mqtt_settings": {"qos": 0}},