Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
интеграция_с_homeassistant [2023/10/21 18:40] Admin |
интеграция_с_homeassistant [2023/11/23 19:50] (текущий) Admin [Светильники] |
||
---|---|---|---|
Строка 14: | Строка 14: | ||
* Любые устройства, | * Любые устройства, | ||
- | ===== Общая настройка MQTT ===== | + | Документация скорректирована, |
- | < | + | Параметры брокера теперь настраиваются только через пользовательский интерфейс в разделе Настройки/ |
- | mqtt: | + | |
- | broker: <IP Address> | + | Теперь предполагается, |
- | port: 1883 | + | который подгружается директивой |
- | client_id: home-assistant-1 | + | < |
- | keepalive: 60 | + | mqtt: !include mqtt.yaml |
- | # username: !secret mqtt_login | + | |
- | # password: !secret mqtt_password | + | |
- | protocol: 3.1 | + | |
- | birth_message: | + | |
- | topic: " | + | |
- | payload: " | + | |
- | qos: 1 | + | |
- | retain: true | + | |
- | will_message: | + | |
- | topic: " | + | |
- | payload: " | + | |
- | qos: 1 | + | |
- | retain: true | + | |
</ | </ | ||
+ | В файле configuration.yaml | ||
+ | Это, действительно, | ||
+ | |||
+ | Далее, даны примеры разделов файла mqtt.yaml, которые можно скорректировать и использовать для своих нужд | ||
Строка 61: | Строка 52: | ||
< | < | ||
sensor: | sensor: | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
icon: " | icon: " | ||
expire_after: | expire_after: | ||
Строка 71: | Строка 61: | ||
payload_not_available: | payload_not_available: | ||
| | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
expire_after: | expire_after: | ||
state_topic: | state_topic: | ||
Строка 80: | Строка 69: | ||
payload_not_available: | payload_not_available: | ||
| | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
icon: " | icon: " | ||
expire_after: | expire_after: | ||
Строка 90: | Строка 78: | ||
payload_not_available: | payload_not_available: | ||
| | ||
- | - platform: mqtt | + | |
- | name: " | + | |
icon: " | icon: " | ||
expire_after: | expire_after: | ||
state_topic: | state_topic: | ||
unit_of_measurement: | unit_of_measurement: | ||
- | | + | |
- | - platform: mqtt | + | - name: " |
- | | + | |
icon: " | icon: " | ||
expire_after: | expire_after: | ||
Строка 104: | Строка 91: | ||
unit_of_measurement: | unit_of_measurement: | ||
| | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
icon: " | icon: " | ||
expire_after: | expire_after: | ||
Строка 115: | Строка 101: | ||
===== Светильники ===== | ===== Светильники ===== | ||
- | |||
< | < | ||
- | |||
- | |||
light: | light: | ||
# дискретный выключатель света (вкл-выкл) | # дискретный выключатель света (вкл-выкл) | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
Строка 128: | Строка 110: | ||
| | ||
# Диммируемый одноцветный светильник | # Диммируемый одноцветный светильник | ||
- | - platform: mqtt | + | - name: Кухня точки |
- | | + | |
command_topic: | command_topic: | ||
state_topic: | state_topic: | ||
Строка 137: | Строка 118: | ||
| | ||
# Цветной LED светильник | # Цветной LED светильник | ||
- | - platform: mqtt | + | |
- | name: Кухня LED | + | |
command_topic: | command_topic: | ||
state_topic: | state_topic: | ||
Строка 147: | Строка 128: | ||
{{a[0]+',' | {{a[0]+',' | ||
{%- endif %}" | {%- endif %}" | ||
- | # brightness_scale: | + | |
brightness_command_topic: | brightness_command_topic: | ||
brightness_state_topic: | brightness_state_topic: | ||
Строка 155: | Строка 136: | ||
color_temp_command_topic: | color_temp_command_topic: | ||
color_temp_state_topic: | color_temp_state_topic: | ||
+ | | ||
+ | | ||
+ | #Новая версия интеграции. Поддерживает не только HSV но и RGBW нотацию цвета. | ||
+ | # | ||
+ | #- то есть RGBW. В этом случае контроллер прозрачно транслирует такой цвет в статусный топик, добавляя признак RGB в начало payload | ||
+ | # предполагается имя контроллера light | ||
+ | | ||
+ | - name: Кухня по новому LED | ||
+ | command_topic: | ||
+ | state_topic: | ||
+ | hs_command_topic: | ||
+ | hs_state_topic: | ||
+ | brightness_command_topic: | ||
+ | brightness_state_topic: | ||
+ | color_temp_command_topic: | ||
+ | color_temp_state_topic: | ||
+ | rgbw_state_topic: | ||
+ | | ||
+ | hs_value_template: | ||
+ | {%set a=value.split(',' | ||
+ | {%if a[1]%} | ||
+ | {{a[0]+',' | ||
+ | {%endif%} | ||
+ | {% endif %}" | ||
+ | |||
+ | brightness_value_template: | ||
+ | {%set a=value.split(',' | ||
+ | {% if a[2] %} | ||
+ | {{ a[2] }} | ||
+ | {% endif %} | ||
+ | {% endif %}" | ||
+ | | ||
+ | color_temp_value_template: | ||
+ | {%set a=value.split(',' | ||
+ | {% if a[3] %} | ||
+ | {{ a[3] }} | ||
+ | {% endif %} | ||
+ | {% endif %}" | ||
+ | |||
+ | rgbw_value_template: | ||
+ | {{value.split()[1]}} | ||
+ | {% endif %}" | ||
+ | | ||
| | ||
| | ||
Строка 163: | Строка 187: | ||
< | < | ||
switch: | switch: | ||
- | - platform: mqtt | + | - name: "Air heat" |
- | | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
- | | + | |
- | name: "Air auto" | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
- | - platform: mqtt | + | |
- | name: " | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
qos: 1 | qos: 1 | ||
- | - platform: mqtt | + | |
- | name: " | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
qos: 1 | qos: 1 | ||
- | - platform: mqtt | + | |
- | name: " | + | |
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
qos: 1 | qos: 1 | ||
- | - platform: mqtt | + | |
- | name: " | + | |
state_topic: | state_topic: | ||
command_topic: | command_topic: | ||
Строка 201: | Строка 224: | ||
< | < | ||
climate: | climate: | ||
- | - platform: mqtt | + | |
- | name: Кондиционер | + | |
modes: | modes: | ||
- " | - " | ||
Строка 230: | Строка 253: | ||
current_temperature_topic: | current_temperature_topic: | ||
- | - platform: mqtt | + | - name: " |
- | | + | |
modes: | modes: | ||
- " | - " | ||
Строка 243: | Строка 265: | ||
current_temperature_topic: | current_temperature_topic: | ||
- | - platform: mqtt | + | |
- | name: " | + | |
modes: | modes: | ||
- " | - " | ||
Строка 259: | Строка 281: | ||
</ | </ | ||
- | | + | |
+ | |||
+ | ===== Увлажнитель ===== | ||
+ | |||
+ | < | ||
+ | humidifier: | ||
+ | - name: " | ||
+ | command_topic: | ||
+ | state_topic: | ||
+ | target_humidity_command_topic: | ||
+ | target_humidity_state_topic: | ||
+ | current_humidity_topic: | ||
+ | max_humidity: | ||
+ | min_humidity: | ||
+ | </ | ||
===== Приточка ===== | ===== Приточка ===== | ||
< | < | ||
climate: | climate: | ||
- | - platform: mqtt | + | |
- | name: Вентиляция | + | |
modes: | modes: | ||
- " | - " | ||
Строка 279: | Строка 316: | ||
| | ||
sensor: | sensor: | ||
- | - platform: mqtt | + | |
- | name: " | + | |
state_topic: | state_topic: | ||
icon: " | icon: " | ||
unit_of_measurement: | unit_of_measurement: | ||
value_template: | value_template: | ||
- | | + | |
- | name: "Fan RPM" | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
unit_of_measurement: | unit_of_measurement: | ||
value_template: | value_template: | ||
- | - platform: mqtt | + | |
- | name: "Fan Current" | + | |
icon: " | icon: " | ||
state_topic: | state_topic: | ||
unit_of_measurement: | unit_of_measurement: | ||
value_template: | value_template: | ||
- | - platform: mqtt | + | |
- | name: "Fan Fault" | + | |
icon: " | icon: " | ||
state_topic: | state_topic: |