Инструменты пользователя

Инструменты сайта


интеграция_с_homeassistant

Это старая версия документа!


Контроллер LightHub прекрасно интегрируется в систему Home Assistant с использованием MQTT

В настоящее время, реализованы и используются следующие интеграции:

* Реле и дискретные выключатели * Диммируемые одноцветные светильники * Диммируемые цветные светильники (RGB/RGBW) * Термостаты теплого пола * Кондиционер * Сенсоры температуры * Сенсоры влажности * Сенсоры CO2

Общая настройка MQTT

      
mqtt:
  broker: 192.168.88.2
  port: 1883
  client_id: home-assistant-1
  keepalive: 60
#  username: !secret mqtt_login
#  password: !secret mqtt_password
  protocol: 3.1
  birth_message:
    topic: "myhome/hass1/LWT"
    payload: "Online"
    qos: 1
    retain: true
  will_message:
    topic: "myhome/hass1/LWT"
    payload: "Offline"
    qos: 1
    retain: true

Сенсоры

В примерах ниже: Имя контроллера: light-d2 Настройка датчика качества воздуха:

  "98":{"T":5,"emit":"myhome/sensor/airq"},
  "99":{"T":6,"emit":"myhome/sensor/humidity"}
sensor:
  - platform: mqtt
    name: "CO2"
    icon: "mdi:periodic-table-co2"
    expire_after: 600
    state_topic: "myhome/sensor/airq/CO2"
    unit_of_measurement: 'ppm'
    availability_topic: "myhome/light-d2/$state"
    payload_available: "ready"
    payload_not_available: "disconnected"
    
  - platform: mqtt
    name: "TVOC"
    expire_after: 600
    state_topic: "myhome/sensor/airq/TVOC"
    unit_of_measurement: 'ppm'
    availability_topic: "myhome/light-d2/$state"
    payload_available: "ready"
    payload_not_available: "disconnected"
    
  - platform: mqtt
    name: "Влажность"
    icon: "mdi:water-percent"
    expire_after: 600
    state_topic: "myhome/sensor/humidity/H"
    unit_of_measurement: '%'
    availability_topic: "myhome/light-d2/$state"
    payload_available: "ready"
    payload_not_available: "disconnected"       
   
  
  
  - platform: mqtt
    name: "Горячая вода"
    icon: "mdi:water-outline"
    state_topic: "myhome/s_out/acount_hot/store"
    unit_of_measurement: 'м3'
  - platform: mqtt
    name: "Холодная вода"
    icon: "mdi:water"
    state_topic: "myhome/s_out/acount_cold/store"
    unit_of_measurement: 'м3'
  - platform: mqtt
    name: "На улице"
    icon: "mdi:thermometer"
    state_topic: "myhome/s_out/t_outside"
    unit_of_measurement: '°C'
    expire_after: 600
    
    
  - platform: mqtt
    name: "Воздух гостиная"
    icon: "mdi:thermometer"
    state_topic: "myhome/s_out/t_kitchen"
    unit_of_measurement: '°C'
    expire_after: 600
  - platform: mqtt
    name: "Влажность ванная"
    icon: "mdi:water-percent"
    expire_after: 600
    state_topic: "myhome/s_out/dhtH"
    unit_of_measurement: '%'
  - platform: mqtt
    name: "Воздух ванная"
    icon: "mdi:thermometer"
    expire_after: 600
    state_topic: "myhome/s_out/dhtT"
    unit_of_measurement: '°C'   
  - platform: mqtt
    name: "Воздух прихожая"
    icon: "mdi:thermometer"
    expire_after: 600
    state_topic: "myhome/s_out/t_aentr"
    unit_of_measurement: '°C'  
  
  - platform: mqtt    
    name: "Воздух душ"
    icon: "mdi:thermometer"
    expire_after: 600
    state_topic: "myhome/s_out/t_abath1"
    unit_of_measurement: '°C' 
    
  - platform: mqtt    
    name: "Воздух кондиционера"
    icon: "mdi:thermometer"
    expire_after: 600
    state_topic: "myhome/s_out/t_ac"
    unit_of_measurement: '°C' 
    
  - platform: mqtt    
    name: "Воздух внеш"
    icon: "mdi:thermometer"
    expire_after: 600
    state_topic: "myhome/s_out/t_ext"
    unit_of_measurement: '°C'      
    
  - platform: mqtt
    name: "Heater power"
    state_topic: "myhome/s_out/fm_stat"
    icon: "mdi:radiator"
    unit_of_measurement: '%'
    value_template: "{{ value_json.pwr }}"
  - platform: mqtt    
    name: "Fan RPM"
    icon: "mdi:fan"
    state_topic: "myhome/s_out/fm_stat"
    unit_of_measurement: 'RPM'
    value_template: "{{ value_json.RPM }}"
  - platform: mqtt  
    name: "Fan Current"
    icon: "mdi:current-ac"
    state_topic: "myhome/s_out/fm_stat"
    unit_of_measurement: 'A'
    value_template: "{{ value_json.I }}"
  - platform: mqtt    
    name: "Fan Fault"
    icon: "mdi:alert"
    state_topic: "myhome/s_out/fm_stat"
    value_template: "{{ value_json.flt }}"   
#  - platform: mqtt    
#    name: "Fan Temp"
#    state_topic: "myhome/s_out/fm_stat"
#    unit_of_measurement: '°C'  
#    value_template: "{{ value_json.t }}"    
#  - platform: mqtt    
#    name: "Fan Temp set"
#    state_topic: "myhome/s_out/fm_stat"
#    unit_of_measurement: '°C'  
#    value_template: "{{ value_json.set }}"     
    

Светильники

  


light:
# дискретный выключатель света (вкл-выкл)
  - platform: mqtt
    name: "Прихожая"
    state_topic: "myhome/s_out/spots_en"
    command_topic: "myhome/in/spots_en"
    qos: 1
    
# Диммируемый одноцветный светильник    
  - platform: mqtt
    name: Кухня точки
    command_topic: "myhome/in/ktc/cmd"
    state_topic: "myhome/s_out/ktc/cmd"
    brightness_scale: 100
    brightness_command_topic: "myhome/in/ktc/set"
    brightness_state_topic: "myhome/s_out/ktc/set"
    
# Цветной LED светильник    
  - platform: mqtt
    name: Кухня LED
    command_topic: "myhome/in/kuh/cmd"
    state_topic: "myhome/s_out/kuh/cmd"
    hs_command_topic: "myhome/in/kuh/set"
    hs_state_topic: "myhome/s_out/kuh/set"  
    hs_value_template: "{{ value.split(',')[0],value.split(',')[1] }}"
    brightness_scale: 100
    brightness_command_topic: "myhome/in/kuh/set"
    brightness_state_topic: "myhome/s_out/kuh/set"
    brightness_value_template: "{{ value.split(',')[2] }}"

Выключатели

    
switch:
  - platform: mqtt
    name: "Air heat"
    icon: "mdi:radiator"
    state_topic: "myhome/s_out/fm_t/cmd"
    command_topic: "myhome/in/fm_t/cmd"
  - platform: mqtt    
    name: "Air auto"
    icon: "mdi:auto-fix"
    state_topic: "myhome/s_out/fm_auto"
    command_topic: "myhome/in/fm_auto"    
  - platform: mqtt
    name: "Перекрыть воду"
    icon: "mdi:water-off"
    state_topic: "myhome/s_out/alock_leak"
    command_topic: "myhome/in/alock"
    qos: 1
  - platform: mqtt
    name: "Сушилки"
    icon: "mdi:radiator"
    state_topic: "myhome/s_out/h_polotenc"
    command_topic: "myhome/in/h_polotenc"
    qos: 1
  - platform: mqtt
    name: "Бойлер большой"
    state_topic: "myhome/s_out/h_boil1"
    command_topic: "myhome/in/h_boil1"
    qos: 1    
  - platform: mqtt
    name: "Бойлер малый"
    state_topic: "myhome/s_out/h_boil2"
    command_topic: "myhome/in/h_boil2"
    qos: 1      

Климат и термостаты

    
climate:
  - platform: mqtt
    name: Кондиционер
    modes:
      - "off"
      - "cool"
      - "fan_only"
      - "heat"
      - "auto"
    fan_modes:
      - "auto"
      - "high"
      - "medium"
      - "low"
    swing_modes:
      - "on"
      - "off"      
    swing_mode_state_topic: "myhome/s_out/ac/swing"
    swing_mode_command_topic: "myhome/in/ac/swing"
    swing_mode_state_template: "{{value|lower()}}"
    mode_command_topic: "myhome/in/ac/cmd"
    mode_state_topic: "myhome/s_out/ac/cmd"
    mode_state_template: "{{value|lower()}}"
    temperature_command_topic: "myhome/in/ac/set"
    temperature_state_topic: "myhome/s_out/ac/set"
    fan_mode_command_topic: "myhome/in/ac/fan"
    fan_mode_state_topic: "myhome/s_out/ac/fan"
    fan_mode_state_template: "{{value|lower()}}"
    current_temperature_topic: "myhome/s_out/ac/temp"

  - platform: mqtt
    name: "Теплый пол душ"
    modes:
      - "off"
      - "heat"
      - "auto"
    mode_command_topic: "myhome/in/h_bath1/cmd"
    temperature_command_topic: "myhome/in/h_bath1/set"
    mode_state_topic: "myhome/s_out/h_bath1/cmd"
    mode_state_template: "{{value|lower()}}"
    temperature_state_topic: "myhome/s_out/h_bath1/set"
    current_temperature_topic: "myhome/s_out/t_bath1"

  - platform: mqtt
    name: "Климат спальня"
    modes:
      - "off"
      - "heat"
      - "auto"
      - "cool"
      - "fan_only"
    mode_command_topic: "myhome/in/c_bedr/cmd"
    temperature_command_topic: "myhome/in/c_bedr/set"
    mode_state_topic: "myhome/s_out/c_bedr/cmd"
    mode_state_template: "{{value|lower()}}"
    temperature_state_topic: "myhome/s_out/c_bedr/set"
    current_temperature_topic: "myhome/s_out/t_bedr"    

    

Приточка

  - platform: mqtt
    name: Вентиляция
    modes:
      - "off"
      - "fan_only"      
      - "heat"
      - "auto"
    mode_command_topic: "myhome/in/fm/cmd"
    mode_state_topic: "myhome/s_out/fm/cmd"
    mode_state_template: "{{value|lower()}}"    
    temperature_command_topic: "myhome/in/fm_t/set"
    temperature_state_topic: "myhome/s_out/fm_t/set"
    current_temperature_topic: "myhome/s_out/fm_stat"
    current_temperature_template: "{{ value_json.t }}"
    
интеграция_с_homeassistant.1586964920.txt.gz · Последнее изменение: 2020/04/15 18:35 — 192.168.88.1