Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.fan Namespace Reference

Classes

class  MqttFan
 

Functions

None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
ConfigType valid_preset_mode_configuration (ConfigType config)
 
ConfigType valid_speed_range_configuration (ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 _PLATFORM_SCHEMA_BASE
 
string CONF_DIRECTION_COMMAND_TEMPLATE = "direction_command_template"
 
string CONF_DIRECTION_COMMAND_TOPIC = "direction_command_topic"
 
string CONF_DIRECTION_STATE_TOPIC = "direction_state_topic"
 
string CONF_DIRECTION_VALUE_TEMPLATE = "direction_value_template"
 
string CONF_OSCILLATION_COMMAND_TEMPLATE = "oscillation_command_template"
 
string CONF_OSCILLATION_COMMAND_TOPIC = "oscillation_command_topic"
 
string CONF_OSCILLATION_STATE_TOPIC = "oscillation_state_topic"
 
string CONF_OSCILLATION_VALUE_TEMPLATE = "oscillation_value_template"
 
string CONF_PAYLOAD_OSCILLATION_OFF = "payload_oscillation_off"
 
string CONF_PAYLOAD_OSCILLATION_ON = "payload_oscillation_on"
 
string CONF_PAYLOAD_RESET_PERCENTAGE = "payload_reset_percentage"
 
string CONF_PAYLOAD_RESET_PRESET_MODE = "payload_reset_preset_mode"
 
string CONF_PERCENTAGE_COMMAND_TEMPLATE = "percentage_command_template"
 
string CONF_PERCENTAGE_COMMAND_TOPIC = "percentage_command_topic"
 
string CONF_PERCENTAGE_STATE_TOPIC = "percentage_state_topic"
 
string CONF_PERCENTAGE_VALUE_TEMPLATE = "percentage_value_template"
 
string CONF_PRESET_MODE_COMMAND_TEMPLATE = "preset_mode_command_template"
 
string CONF_PRESET_MODE_COMMAND_TOPIC = "preset_mode_command_topic"
 
string CONF_PRESET_MODE_STATE_TOPIC = "preset_mode_state_topic"
 
string CONF_PRESET_MODE_VALUE_TEMPLATE = "preset_mode_value_template"
 
string CONF_PRESET_MODES_LIST = "preset_modes"
 
string CONF_SPEED_RANGE_MAX = "speed_range_max"
 
string CONF_SPEED_RANGE_MIN = "speed_range_min"
 
string DEFAULT_NAME = "MQTT Fan"
 
string DEFAULT_PAYLOAD_OFF = "OFF"
 
string DEFAULT_PAYLOAD_ON = "ON"
 
string DEFAULT_PAYLOAD_RESET = "None"
 
int DEFAULT_SPEED_RANGE_MAX = 100
 
int DEFAULT_SPEED_RANGE_MIN = 1
 
 DISCOVERY_SCHEMA
 
 MQTT_FAN_ATTRIBUTES_BLOCKED
 
string OSCILLATE_OFF_PAYLOAD = "oscillate_off"
 
string OSCILLATE_ON_PAYLOAD = "oscillate_on"
 
int PARALLEL_UPDATES = 0
 
 PLATFORM_SCHEMA_MODERN
 

Detailed Description

Support for MQTT fans.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.mqtt.fan.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up MQTT fan through YAML and through MQTT discovery.

Definition at line 190 of file fan.py.

◆ valid_preset_mode_configuration()

ConfigType homeassistant.components.mqtt.fan.valid_preset_mode_configuration ( ConfigType  config)
Validate that the preset mode reset payload is not one of the preset modes.

Definition at line 119 of file fan.py.

◆ valid_speed_range_configuration()

ConfigType homeassistant.components.mqtt.fan.valid_speed_range_configuration ( ConfigType  config)
Validate that the fan speed_range configuration is valid, throws if it isn't.

Definition at line 110 of file fan.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.mqtt.fan._LOGGER = logging.getLogger(__name__)
private

Definition at line 107 of file fan.py.

◆ _PLATFORM_SCHEMA_BASE

homeassistant.components.mqtt.fan._PLATFORM_SCHEMA_BASE
private

Definition at line 126 of file fan.py.

◆ CONF_DIRECTION_COMMAND_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_DIRECTION_COMMAND_TEMPLATE = "direction_command_template"

Definition at line 65 of file fan.py.

◆ CONF_DIRECTION_COMMAND_TOPIC

string homeassistant.components.mqtt.fan.CONF_DIRECTION_COMMAND_TOPIC = "direction_command_topic"

Definition at line 63 of file fan.py.

◆ CONF_DIRECTION_STATE_TOPIC

string homeassistant.components.mqtt.fan.CONF_DIRECTION_STATE_TOPIC = "direction_state_topic"

Definition at line 62 of file fan.py.

◆ CONF_DIRECTION_VALUE_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_DIRECTION_VALUE_TEMPLATE = "direction_value_template"

Definition at line 64 of file fan.py.

◆ CONF_OSCILLATION_COMMAND_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_OSCILLATION_COMMAND_TEMPLATE = "oscillation_command_template"

Definition at line 82 of file fan.py.

◆ CONF_OSCILLATION_COMMAND_TOPIC

string homeassistant.components.mqtt.fan.CONF_OSCILLATION_COMMAND_TOPIC = "oscillation_command_topic"

Definition at line 80 of file fan.py.

◆ CONF_OSCILLATION_STATE_TOPIC

string homeassistant.components.mqtt.fan.CONF_OSCILLATION_STATE_TOPIC = "oscillation_state_topic"

Definition at line 79 of file fan.py.

◆ CONF_OSCILLATION_VALUE_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_OSCILLATION_VALUE_TEMPLATE = "oscillation_value_template"

Definition at line 81 of file fan.py.

◆ CONF_PAYLOAD_OSCILLATION_OFF

string homeassistant.components.mqtt.fan.CONF_PAYLOAD_OSCILLATION_OFF = "payload_oscillation_off"

Definition at line 84 of file fan.py.

◆ CONF_PAYLOAD_OSCILLATION_ON

string homeassistant.components.mqtt.fan.CONF_PAYLOAD_OSCILLATION_ON = "payload_oscillation_on"

Definition at line 83 of file fan.py.

◆ CONF_PAYLOAD_RESET_PERCENTAGE

string homeassistant.components.mqtt.fan.CONF_PAYLOAD_RESET_PERCENTAGE = "payload_reset_percentage"

Definition at line 70 of file fan.py.

◆ CONF_PAYLOAD_RESET_PRESET_MODE

string homeassistant.components.mqtt.fan.CONF_PAYLOAD_RESET_PRESET_MODE = "payload_reset_preset_mode"

Definition at line 78 of file fan.py.

◆ CONF_PERCENTAGE_COMMAND_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_PERCENTAGE_COMMAND_TEMPLATE = "percentage_command_template"

Definition at line 69 of file fan.py.

◆ CONF_PERCENTAGE_COMMAND_TOPIC

string homeassistant.components.mqtt.fan.CONF_PERCENTAGE_COMMAND_TOPIC = "percentage_command_topic"

Definition at line 67 of file fan.py.

◆ CONF_PERCENTAGE_STATE_TOPIC

string homeassistant.components.mqtt.fan.CONF_PERCENTAGE_STATE_TOPIC = "percentage_state_topic"

Definition at line 66 of file fan.py.

◆ CONF_PERCENTAGE_VALUE_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_PERCENTAGE_VALUE_TEMPLATE = "percentage_value_template"

Definition at line 68 of file fan.py.

◆ CONF_PRESET_MODE_COMMAND_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_PRESET_MODE_COMMAND_TEMPLATE = "preset_mode_command_template"

Definition at line 76 of file fan.py.

◆ CONF_PRESET_MODE_COMMAND_TOPIC

string homeassistant.components.mqtt.fan.CONF_PRESET_MODE_COMMAND_TOPIC = "preset_mode_command_topic"

Definition at line 74 of file fan.py.

◆ CONF_PRESET_MODE_STATE_TOPIC

string homeassistant.components.mqtt.fan.CONF_PRESET_MODE_STATE_TOPIC = "preset_mode_state_topic"

Definition at line 73 of file fan.py.

◆ CONF_PRESET_MODE_VALUE_TEMPLATE

string homeassistant.components.mqtt.fan.CONF_PRESET_MODE_VALUE_TEMPLATE = "preset_mode_value_template"

Definition at line 75 of file fan.py.

◆ CONF_PRESET_MODES_LIST

string homeassistant.components.mqtt.fan.CONF_PRESET_MODES_LIST = "preset_modes"

Definition at line 77 of file fan.py.

◆ CONF_SPEED_RANGE_MAX

string homeassistant.components.mqtt.fan.CONF_SPEED_RANGE_MAX = "speed_range_max"

Definition at line 72 of file fan.py.

◆ CONF_SPEED_RANGE_MIN

string homeassistant.components.mqtt.fan.CONF_SPEED_RANGE_MIN = "speed_range_min"

Definition at line 71 of file fan.py.

◆ DEFAULT_NAME

string homeassistant.components.mqtt.fan.DEFAULT_NAME = "MQTT Fan"

Definition at line 86 of file fan.py.

◆ DEFAULT_PAYLOAD_OFF

string homeassistant.components.mqtt.fan.DEFAULT_PAYLOAD_OFF = "OFF"

Definition at line 88 of file fan.py.

◆ DEFAULT_PAYLOAD_ON

string homeassistant.components.mqtt.fan.DEFAULT_PAYLOAD_ON = "ON"

Definition at line 87 of file fan.py.

◆ DEFAULT_PAYLOAD_RESET

string homeassistant.components.mqtt.fan.DEFAULT_PAYLOAD_RESET = "None"

Definition at line 89 of file fan.py.

◆ DEFAULT_SPEED_RANGE_MAX

int homeassistant.components.mqtt.fan.DEFAULT_SPEED_RANGE_MAX = 100

Definition at line 91 of file fan.py.

◆ DEFAULT_SPEED_RANGE_MIN

int homeassistant.components.mqtt.fan.DEFAULT_SPEED_RANGE_MIN = 1

Definition at line 90 of file fan.py.

◆ DISCOVERY_SCHEMA

homeassistant.components.mqtt.fan.DISCOVERY_SCHEMA
Initial value:
1 = vol.All(
2  _PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA),
3  valid_speed_range_configuration,
4  valid_preset_mode_configuration,
5 )

Definition at line 183 of file fan.py.

◆ MQTT_FAN_ATTRIBUTES_BLOCKED

homeassistant.components.mqtt.fan.MQTT_FAN_ATTRIBUTES_BLOCKED
Initial value:
1 = frozenset(
2  {
3  fan.ATTR_DIRECTION,
4  fan.ATTR_OSCILLATING,
5  fan.ATTR_PERCENTAGE_STEP,
6  fan.ATTR_PERCENTAGE,
7  fan.ATTR_PRESET_MODE,
8  fan.ATTR_PRESET_MODES,
9  }
10 )

Definition at line 96 of file fan.py.

◆ OSCILLATE_OFF_PAYLOAD

string homeassistant.components.mqtt.fan.OSCILLATE_OFF_PAYLOAD = "oscillate_off"

Definition at line 94 of file fan.py.

◆ OSCILLATE_ON_PAYLOAD

string homeassistant.components.mqtt.fan.OSCILLATE_ON_PAYLOAD = "oscillate_on"

Definition at line 93 of file fan.py.

◆ PARALLEL_UPDATES

int homeassistant.components.mqtt.fan.PARALLEL_UPDATES = 0

Definition at line 60 of file fan.py.

◆ PLATFORM_SCHEMA_MODERN

homeassistant.components.mqtt.fan.PLATFORM_SCHEMA_MODERN
Initial value:
1 = vol.All(
2  _PLATFORM_SCHEMA_BASE,
3  valid_speed_range_configuration,
4  valid_preset_mode_configuration,
5 )

Definition at line 177 of file fan.py.