Skip to content

Commit df18422

Browse files
committed
Initial MQTT fan docs
1 parent 4a73e9c commit df18422

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

source/_components/fan.mqtt.markdown

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: page
3+
title: "MQTT Fan"
4+
description: "Instructions how to integrate MQTT fans into Home Assistant."
5+
date: 2016-08-27 09:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: mqtt.png
11+
ha_category: Fan
12+
ha_release: 0.27
13+
ha_iot_class: depends
14+
---
15+
16+
The `mqtt` fan platform let you control your MQTT enabled fans.
17+
18+
In an ideal scenario, the MQTT device will have a `state_topic` to publish state changes. If these messages are published with `RETAIN` flag, the MQTT fan will receive an instant state update after subscription and will start with correct state. Otherwise, the initial state of the fan will be `false`.
19+
20+
When a `state_topic` is not available, the fan will work in optimistic mode. In this mode, the fan will immediately change state after every command. Otherwise, the fan will wait for state confirmation from device (message from `state_topic`).
21+
22+
Optimistic mode can be forced, even if state topic is available. Try to enable it, if experiencing incorrect fan operation.
23+
24+
To enable MQTT fans in your installation, add the following to your `configuration.yaml` file:
25+
26+
```yaml
27+
# Example configuration.yml entry
28+
fan:
29+
platform: mqtt
30+
name: Living room
31+
state_topic: "home/living-room/fan"
32+
command_topic: "home/living-room/fan/set"
33+
payload_on: "ON"
34+
payload_off: "OFF"
35+
optimistic: false
36+
qos: 0
37+
retain: true
38+
value_template: '{% raw %}{{ value.x }}{% endraw %}'
39+
```
40+
41+
Configuration variables:
42+
43+
- **name** (*Optional*): The name of the lock. Default is 'MQTT Lock'.
44+
- **state_topic** (*Optional*): The MQTT topic subscribed to receive state updates.
45+
- **command_topic** (*Required*): The MQTT topic to publish commands to change the lock state.
46+
- **payload_on** (*Optional*): The payload that represents the running state. Default is "ON".
47+
- **payload_off** (*Optional*): The payload that represents the stop state. Default is "OFF".
48+
- **optimistic** (*Optional*): Flag that defines if lock works in optimistic mode. Default is `true` if no state topic defined, else `false`.
49+
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
50+
- **retain** (*Optional*): If the published message should have the retain flag on or not.
51+
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
52+
53+
<p class='note warning'>
54+
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
55+
</p>

0 commit comments

Comments
 (0)