Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 61 additions & 42 deletions source/_integrations/fan.mqtt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,30 @@ To enable MQTT fans in your installation, add the following to your `configurati

```yaml
# Example configuration.yaml entry
mqtt:
fan:
- command_topic: "bedroom_fan/on/set"
```

<a id='new_format'></a>

{% details "Previous configuration format" %}

The configuration format of manual configured MQTT items has changed.
The old format that places configurations under the `fan` platform key
should no longer be used and is deprecated.

The above example shows the new and modern way,
this is the previous/old example:

```yaml
fan:
- platform: mqtt
- platform: "mqtt"
command_topic: "bedroom_fan/on/set"
```

{% enddetails %}

{% configuration %}
availability:
description: A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic`.
Expand Down Expand Up @@ -298,30 +317,30 @@ There are 10 speeds within the speed range, so `percentage_step` = 100 / 10 ste

```yaml
# Example using percentage based speeds with preset modes configuration.yaml
fan:
- platform: mqtt
name: "Bedroom Fan"
state_topic: "bedroom_fan/on/state"
command_topic: "bedroom_fan/on/set"
oscillation_state_topic: "bedroom_fan/oscillation/state"
oscillation_command_topic: "bedroom_fan/oscillation/set"
percentage_state_topic: "bedroom_fan/speed/percentage_state"
percentage_command_topic: "bedroom_fan/speed/percentage"
preset_mode_state_topic: "bedroom_fan/preset/preset_mode_state"
preset_mode_command_topic: "bedroom_fan/preset/preset_mode"
preset_modes:
- "auto"
- "smart"
- "whoosh"
- "eco"
- "breeze"
qos: 0
payload_on: "true"
payload_off: "false"
payload_oscillation_on: "true"
payload_oscillation_off: "false"
speed_range_min: 1
speed_range_max: 10
mqtt:
fan:
- name: "Bedroom Fan"
state_topic: "bedroom_fan/on/state"
command_topic: "bedroom_fan/on/set"
oscillation_state_topic: "bedroom_fan/oscillation/state"
oscillation_command_topic: "bedroom_fan/oscillation/set"
percentage_state_topic: "bedroom_fan/speed/percentage_state"
percentage_command_topic: "bedroom_fan/speed/percentage"
preset_mode_state_topic: "bedroom_fan/preset/preset_mode_state"
preset_mode_command_topic: "bedroom_fan/preset/preset_mode"
preset_modes:
- "auto"
- "smart"
- "whoosh"
- "eco"
- "breeze"
qos: 0
payload_on: "true"
payload_off: "false"
payload_oscillation_on: "true"
payload_oscillation_off: "false"
speed_range_min: 1
speed_range_max: 10
```

### Configuration using command templates
Expand All @@ -332,23 +351,23 @@ This example demonstrates how to use command templates with JSON output.

```yaml
# Example configuration.yaml with command templates
fan:
- platform: mqtt
name: "Bedroom Fan"
command_topic: "bedroom_fan/on/set"
command_template: "{ state: '{{ value }}'}"
oscillation_command_topic: "bedroom_fan/oscillation/set"
oscillation_command_template: "{ oscillation: '{{ value }}'}"
percentage_command_topic: "bedroom_fan/speed/percentage"
percentage_command_template: "{ percentage: '{{ value }}'}"
preset_mode_command_topic: "bedroom_fan/preset/preset_mode"
preset_mode_command_template: "{ preset_mode: '{{ value }}'}"
preset_modes:
- "auto"
- "smart"
- "whoosh"
- "eco"
- "breeze"
mqtt:
fan:
- name: "Bedroom Fan"
command_topic: "bedroom_fan/on/set"
command_template: "{ state: '{{ value }}'}"
oscillation_command_topic: "bedroom_fan/oscillation/set"
oscillation_command_template: "{ oscillation: '{{ value }}'}"
percentage_command_topic: "bedroom_fan/speed/percentage"
percentage_command_template: "{ percentage: '{{ value }}'}"
preset_mode_command_topic: "bedroom_fan/preset/preset_mode"
preset_mode_command_template: "{ preset_mode: '{{ value }}'}"
preset_modes:
- "auto"
- "smart"
- "whoosh"
- "eco"
- "breeze"
```

{% endraw %}
Loading