Перенастройка HomeAssistant с ChatGPT
Configuration.yaml
# ===============================
# Home Assistant — базовые настройки
# ===============================
homeassistant:
name: Home Assistant
latitude: !secret latitude_coord
longitude: !secret longitude_coord
elevation: 86
unit_system: metric
time_zone: Europe/Samara
country: RU
customize: !include customize.yaml
packages: !include_dir_named packages
# ===============================
# Базовая функциональность
# ===============================
default_config:
logger:
default: warning
# ===============================
# Сервисы
# ===============================
wake_on_lan:
tts:
- platform: google_translate
# ===============================
# Хранилище и БД
# ===============================
recorder: !include includes/recorder.yaml
sql: !include includes/sql.yaml
# ===============================
# YAML-логика
# ===============================
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
group: !include groups.yaml
sensor: !include_dir_merge_list includes/sensor
switch: !include_dir_merge_list includes/switch
# ===============================
# HTTP / Reverse Proxy
# ===============================
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.1.200
# ===============================
# Frontend
# ===============================
fontawesome:
frontend:
extra_module_url:
- /hacsfiles/lovelace-card-mod/card-mod.js
- /hacsfiles/ha-yandex-icons/yandex-icons.js
themes: !include_dir_merge_named themes
# ===============================
# Интеграции
# ===============================
narodmon:
devices:
- name: "Narodmon"
scan_interval: "01:00"
sensors:
- temperature
- humidity
- pressure
timeout: 120
# ===============================
# Панели (устаревшее, но оставляем)
# ===============================
panel_custom:
- name: ha_integ
sidebar_title: "Устройства и службы"
sidebar_icon: mdi:devices
js_url: /api/hassio/app/entrypoint.js
url_path: "config/integrations"
embed_iframe: true
require_admin: true
- name: ha_auto
sidebar_title: "Автоматизации и сцены"
sidebar_icon: mdi:robot
js_url: /api/hassio/app/entrypoint.js
url_path: "config/automation"
embed_iframe: true
require_admin: true
Пакет koridor.yaml
# packages/koridor.yaml
# --------------------------
# ДиммерКоридор — пакет управления светом и свет коридора
# --------------------------
light:
- platform: template
lights:
koridor_osnovnoi:
friendly_name: "Коридор Основной"
value_template: "{{ is_state('light.koridor_osnovnoi', 'on') }}"
turn_on:
service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
turn_off:
service: light.turn_off
target:
entity_id: light.koridor_osnovnoiтермостатом
# --------------------------
# Таймер авто-выключения
# --------------------------
timer:
koridor_auto_off:
duration: '03:00:00'
# --------------------------
# Автоматизации управления светом
# --------------------------
automation:
# 1.Одинарное нажатие Switch_Coridor — (левая клавиша, одинарное нажатиеклавиша)
- alias: Коридор — Switch_Coridor одинарное
mode: restart
trigger:
- platform: state
entity_id: sensor.switch_coridor_action
to: single_left
action:
- choose:
# Если свет включен → выключаем + сброс таймера
- conditions:
- condition: state
entity_id: light.koridor_osnovnoi
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.koridor_osnovnoi
- service: timer.cancel
target:
entity_id: timer.koridor_auto_off
# Если свет выключен → включаем с умной яркостью + старт таймера
- default:
- choose:
- conditions:
- condition: sun
after: sunset
- condition: time
after: '23:00:00'
sequence:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 50
- default:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 100
- service: timer.start
target:
entity_id: timer.koridor_auto_off
# 2.Двойное нажатие Switch_Coridor — левая клавиша, двойное нажатие
- alias: Коридор — Switch_Coridor двойное
mode: single
trigger:
- platform: state
entity_id: sensor.switch_coridor_action
to: double_left
action:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 100
- service: timer.start
target:
entity_id: timer.koridor_auto_off
# 3.Одинарное нажатие Switch_Kitchen — (правая клавиша одинарное нажатие (проходной)клавиша)
- alias: Коридор — Switch_Kitchen одинарное
mode: restart
trigger:
- platform: state
entity_id: sensor.switch_kitchen_action
to: single_right
action:
- choose:
# Если свет включен → выключаем + сброс таймера
- conditions:
- condition: state
entity_id: light.koridor_osnovnoi
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.koridor_osnovnoi
- service: timer.cancel
target:
entity_id: timer.koridor_auto_off
# Если свет выключен → включаем с умной яркостью + старт таймера
- default:
- choose:
- conditions:
- condition: sun
after: sunset
- condition: time
after: '23:00:00'
sequence:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 50
- default:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 100
- service: timer.start
target:
entity_id: timer.koridor_auto_off
# 4.Двойное нажатие Switch_Kitchen — правая клавиша двойное нажатие
- alias: Коридор — Switch_Kitchen двойное
mode: single
trigger:
- platform: state
entity_id: sensor.switch_kitchen_action
to: double_right
action:
- service: light.turn_on
target:
entity_id: light.koridor_osnovnoi
data:
brightness_pct: 100
- service: timer.start
target:
entity_id: timer.koridor_auto_off
# 5.Оба Обенажатия клавишина —любом выключателе → выключить все светильникивсё
- alias: Коридор — Обе клавиши выключить все
mode: single
trigger:
- platform: state
entity_id: sensor.switch_coridor_action
to: single_both
- platform: state
entity_id: sensor.switch_coridor_action
to: double_both
- platform: state
entity_id: sensor.switch_kitchen_action
to: single_both
- platform: state
entity_id: sensor.switch_kitchen_action
to: double_both
action:
- service: light.turn_off
target:
entity_id:
- light.koridor_osnovnoi
# ДобавьтеЗдесь здесьможно остальныедобавить другие светильники по домудома
- service: timer.cancel
target:
entity_id: timer.koridor_auto_off
# 6.Таймер Сброс таймерасбрасывается при ручном выключении света
- alias: Коридор — Сброс таймера при ручномвыключении выключениисвета
mode: single
trigger:
- platform: state
entity_id: light.koridor_osnovnoi
to: 'off'
action:
- service: timer.cancel
target:
entity_id: timer.koridor_auto_off
# 7. Авто-выключение по окончании таймера
- alias: Коридор — Авто-выключение по таймеру
mode: single
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.koridor_auto_off
action:
- service: light.turn_off
target:
entity_id: light.koridor_osnovnoi
# --------------------------
# Термостат корикоридора
# --------------------------
climate:
- platform: template
climates:
thermostat_coridor:
friendly_name: "Термостат коридора"
value_template: "{{ state_attr('climate.thermostat_coridor','current_temperature') }}"
target_temperature_template: "{{ state_attr('climate.thermostat_coridor','temperature') }}"
turn_on:
service: climate.set_hvac_mode
target:
entity_id: climate.thermostat_coridor
data:
hvac_mode: heat
turn_off:
service: climate.set_hvac_mode
target:
entity_id: climate.thermostat_coridor
data:
hvac_mode: off
# --------------------------
# Сцены
# --------------------------
scene:
- name: Koridor On
entities:
light.koridor_osnovnoi:
state: on
brightness_pct: 100
- name: Koridor Off
entities:
light.koridor_osnovnoi:
state: off