Skip to content

Commit 29a60e8

Browse files
tinloaffabaff
authored andcommitted
MQTT climate documentation (home-assistant#3448)
* document climate.mqtt * tweaks per @Landrash++ * Add additional configuration * Document more mqtt options * Document optimistic mode * Remove sensor
1 parent 97e2d20 commit 29a60e8

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
layout: page
3+
title: "MQTT HVAC"
4+
description: "Instructions how to integrate MQTT HVAC into Home Assistant."
5+
date: 2017-07-31 19:59
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: heat-control.png
11+
ha_category: Climate
12+
ha_release: 0.55
13+
ha_iot_class: "Local Polling"
14+
---
15+
16+
The `mqtt` climate platform let you control your MQTT enabled HVAC devices.
17+
18+
The platform currently works in optimistic mode, which means it does not obtain states from MQTT topics, but it sends and remembers control commands.
19+
20+
It uses a sensor under the hood to obtain the current temperature.
21+
22+
```yaml
23+
# Example configuration.yaml entry
24+
climate:
25+
- platform: mqtt
26+
name: Study
27+
current_temperature_topic: /sensors/hvac_study/current_temp
28+
temperature_command_topic: /sensors/hvac_study/target_temp
29+
```
30+
31+
Configuration variables *except* for MQTT topics:
32+
33+
- **name** (*Required*): Name of MQTT HVAC.
34+
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is `0` and will also be used to publishing messages.
35+
- **retain** (*Optional*): If the published message should have the retain flag on or not.
36+
- **send_if_off** (*Optional*): Set to `false` to suppress sending of all MQTT messages when the current mode is `Off`. Defaults to `true`.
37+
- **initial** (*Optional*): Set the initial target temperature. Defaults to 21 degrees.
38+
- **payload_on** (*Optional*): For MQTT topics that control an `on` / `off` value (e.g., `aux_command_topic`), set the value that should be sent for `on`. Defaults to 'ON'.
39+
- **payload_off** (*Optional*): For MQTT topics that control an `on` / `off` value (e.g., `aux_command_topic`), set the value that should be sent for `off`. Defaults to 'OFF'.
40+
41+
Configuration of the MQTT topics:
42+
43+
- **current_temperature_topic** (*Optional*): The MQTT topic on which to listen for the current temperature
44+
- **power_command_topic** (*Optional*): The MQTT topic to publish commands to change the power state. This is useful if your device has a separate power toggle in addition to mode.
45+
- **mode_command_topic** (*Optional*): The MQTT topic to publish commands to change the HVAC operation mode.
46+
- **mode_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the HVAC operation mode. If this is not set, the operation mode works in optimistic mode (see below).
47+
- **temperature_command_topic** (*Optional*): The MQTT topic to publish commands to change the target temperature.
48+
- **temperature_state_topic** (*Optional*): The MQTT topic to subscribe for changes in the target temperature. If this is not set, the target temperature works in optimistic mode (see below).
49+
- **fan_mode_command_topic** (*Optional*): The MQTT topic to publish commands to change the fan mode.
50+
- **fan_mode_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the HVAC fan mode. If this is not set, the fan mode works in optimistic mode (see below).
51+
- **swing_mode_command_topic** (*Optional*): The MQTT topic to publish commands to change the swing mode.
52+
- **swing_mode_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the HVAC swing mode. If this is not set, the swing mode works in optimistic mode (see below).
53+
- **away_mode_command_topic** (*Optional*): The MQTT topic to publish commands to change the away mode.
54+
- **away_mode_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the HVAC away mode. If this is not set, the away mode works in optimistic mode (see below).
55+
- **hold_command_topic** (*Optional*): The MQTT topic to publish commands to change the hold mode.
56+
- **hold_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the HVAC hold mode. If this is not set, the hold mode works in optimistic mode (see below).
57+
- **aux_command_topic** (*Optional*): The MQTT topic to publish commands to switch auxiliary heat.
58+
- **aux_state_topic** (*Optional*): The MQTT topic to subscribe for changes of the auxiliary heat mode. If this is not set, the auxiliary heat mode works in optimistic mode (see below).
59+
60+
#### Optimistic mode
61+
62+
If a property works in *optimistic mode* (when the corresponding state topic is not set), home assistant will assume that any state changes published to the command topics did work and change the internal state of the entity immediately after publishing to the command topic. If it does not work in optimistic mode, the internal state of the entity is only updated when the requested update is confirmed by the device through the state topic.
63+
64+
### {% linkable_title Example %}
65+
66+
A full configuration example looks like the one below.
67+
68+
```yaml
69+
# Full example configuration.yaml entry
70+
climate:
71+
- platform: mqtt
72+
name: Study
73+
target_sensor: sensor.study_temperature
74+
modes:
75+
- off
76+
- cool
77+
- fan_only
78+
swing_modes:
79+
- on
80+
- off
81+
fan_modes:
82+
- high
83+
- medium
84+
- low
85+
power_command_topic: "study/ac/power/set"
86+
mode_command_topic: "study/ac/mode/set"
87+
temperature_command_topic: "study/ac/temperature/set"
88+
fan_mode_command_topic: "study/ac/fan/set"
89+
swing_mode_command_topic: "study/ac/swing/set"
90+
```

0 commit comments

Comments
 (0)