Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################################################
- # #
- # /.\ '|| |''||''|.|'''','||''''| #
- # // \\ || || || || . #
- # //...\\ || || || ||'''| #
- # // \\ || || || || #
- # .// \\.||...|..||..|`|....'.||....| #
- # #
- #############################################################
- yandex_dialogs:
- name: Диалог
- allowed_user_ids:
- - 4B1C7FB***************************************
- yandex_smart_home_fix:
- yandex_station:
- username: !secret yandexid
- password: !secret yandexpass
- tts_service_name: alice_say
- intents:
- Да: хорошо
- Тест:
- Включи:
- Открой:
- Покажи кто там:
- input_text:
- last_active:
- name: Активная станция
- conversation:
- intents:
- media_player.yandex_station: [.+]
- #media_player.yandex_station_mini: [.+]
- yandex_smart_home:
- filter:
- include_domains:
- - switch
- - light
- - climate
- include_entities:
- - script.1_0000000
- - media_player.yandex_intents
- - script.apple_tv_off
- - water_heater.kettle_rk_m171s
- - cover.curtain_cover
- - script.1591727180842
- - script.1_1111111111
- - script.1593116198914
- - script.1_11123
- - script.1_11124
- - script.1_11125
- - script.1_11126
- - script.1_11128
- - script.1_11129
- - script.1_11130
- - script.1_11131
- - script.1_11132
- - script.1_11133
- - script.1_11134
- - script.1_11135
- - script.1_11136
- - script.1_11137
- - script.1_11138
- - script.1111111111
- - script.1_11212
- - script.1_11213
- - input_boolean.atv_switch
- - script.atv_kinopoick
- - script.atv_youtube
- - script.skip_ad
- - script.low_brightness_tv
- - script.high_brightness_tv
- - script.game_mode_tv_off
- - script.game_mode_tv_on
- exclude_entities:
- - light.bedroom_tradfri_1
- - light.bedroom_tradfri_2
- - light.bedroom_tradfri_3
- - light.bedroom_tradfri_4
- - light.bedroom_tradfri_5
- - light.bath_tradfri_1
- - light.bath_tradfri_2
- - light.bath_tradfri_3
- - light.kitchen_tradfri_1
- - light.kitchen_tradfri_2
- - light.kitchen_tradfri_3
- - light.kitchen_tradfri_4
- - light.kitchen_tradfri_5
- - light.kitchen_tradfri_6
- - light.kitchen_leds
- - switch.zigbee2mqtt_main_join
- - switch.asus
- - switch.xiaomi_airpurifier_buzzer
- - switch.xiaomi_airpurifier_child_lock
- - switch.xiaomi_airpurifier_led
- - climate.terneo_2
- - switch.sonoff_1000745226
- - switch.hallway_sw_right
- input_datetime:
- alice_timer:
- name: Время таймера
- has_date: false
- has_time: true
- #############################################################
- # INTENTS #
- #############################################################
- intent_script:
- yandex_default:
- action:
- - service: persistent_notification.create
- data:
- title: Команда из Яндекса
- message: "{{ text }}"
- speech:
- text: >-
- {% if text == 'привет' %}
- {{ ['слушаю', 'здесь я', 'на связи']|random }}
- {% elif text == 'какая температура в спальне' %}
- Температура {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C
- {% elif text == 'какая температура в ванной' %}
- Температура {{ states("sensor.bath_temp_humidity_temperature")|round }} °C
- {% elif text == 'какая температура на кухне' %}
- Температура {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C
- {% else %}
- Не могу выполнить: {{ text }}
- {% endif %}
- calc:
- action:
- - service: persistent_notification.create
- data_template:
- title: Яндекс Калькулятор
- message: "{{ text }}"
- speech:
- text: >-
- {% if action == 'плюс' %}
- {{ x+y }}
- {% elif action == 'минус' %}
- {{ x-y }}
- {% elif action == 'умножить на' %}
- {{ x*y }}
- {% elif action == 'разделить на' %}
- {{ x/y }}
- {% endif %}
- temperature:
- speech:
- text: >-
- {% if room == 'в спальне' %}
- Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C
- {% elif room == 'в ванной' %}
- Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C
- {% elif room == 'на кухне' %}
- Температура на кухне {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C
- {% elif room == 'дома' %}
- Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C,
- в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C,
- на кухне {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C,
- теплый пол {% if states('climate.terneo_2') == 'heat' %} включен {% else %} выключен {% endif %},
- кондиционер {% if states('binary_sensor.ac_status') == 'on' %} включен {% else %} выключен {% endif %},
- вытяжка в ванной {% if states('switch.bathroom_fan_switch') == 'on' %} включена {% else %} выключена {% endif %}
- {% endif %}
- state:
- speech:
- text: >-
- {% if room == 'в спальне' or room == 'спальни' %}
- . В спальне включены следующие устройства {% if states('light.bedroom_lights') == 'on' %} люстра. {% endif %}
- {% if states('switch.bed_led_switch') == 'on' %} подсветка кровати. {% endif %}
- {% if states('light.bedroom') == 'on' %} подсветка тумбы. {% endif %}
- {% if states('switch.balcony_light_switch') == 'on' %} подсветка балкона. {% endif %}
- {% if states('binary_sensor.ac_status') == 'on' %} кондиционер. {% endif %}
- {% if states('media_player.samsung_tv_remote') == 'on' %} телевизор. {% endif %}
- {% if (state_attr('fan.purifier', 'motor_speed')) > '800' | int%}очиститель.{% endif %}
- шторы{% if states('cover.curtain_cover') == 'open' %} открыты {% else %} закрыты {% endif %}
- {% elif room == 'в ванной' or room == 'ванной' %}
- . В ванной {% if states('switch.bathroom_fan_switch') == 'on' or states('light.bathroom_lights') == 'on' %}
- включены следующие устройства {% if states('switch.bathroom_fan_switch') == 'on' %} вытяжка. {% endif %}
- {% if states('light.bathroom_lights') == 'on' %} освещение {% endif %}
- {% else %} всё выключено {% endif %}
- {% elif room == 'на кухне' or room == 'кухни' %}
- . На кухне {% if states('light.kitchen_lights') == 'on' or states('light.kitchen') == 'on'
- or states('water_heater.kettle_rk_m171s') == 'electric' or states('climate.terneo_2') == 'heat' %} включены следующие устройства
- {% if states('light.kitchen_lights') == 'on' %} люстра. {% endif %} {% if states('light.kitchen') == 'on' %} подсветка пола. {% endif %}
- {% if states('light.sonoff_100079c574') == 'on' %} лента под потолком. {% endif %} {% if states('water_heater.kettle_rk_m171s') == 'electric' %} чайник. {% endif %}
- {% if states('climate.terneo_2') == 'heat' %} теплый пол настроен на температуру {{state_attr('climate.terneo_2', 'temperature') | int }} °C {% endif %}
- {% else %} всё выключено {% endif %}
- {% elif room == 'дома' %}
- . В спальне включены следующие устройства. {% if states('light.bedroom_lights') == 'on' %} люстра. {% endif %}
- {% if states('switch.bed_led_switch') == 'on' %} подсветка кровати. {% endif %}
- {% if states('light.bedroom') == 'on' %} подсветка тумбы. {% endif %}
- {% if states('switch.balcony_light_switch') == 'on' %} подсветка балкона. {% endif %}
- {% if states('binary_sensor.ac_status') == 'on' %} кондиционер. {% endif %}
- {% if states('media_player.samsung_tv_remote') == 'on' %} телевизор. {% endif %}
- {% if (state_attr('fan.purifier', 'motor_speed')) > '800' | int%}очиститель.{% endif %}
- шторы{% if states('cover.curtain_cover') == 'open' %} открыты {% else %} закрыты {% endif %}.
- В ванной {% if states('switch.bathroom_fan_switch') == 'on' or states('light.bathroom_lights') == 'on' %} включены следующие устройства
- {% if states('switch.bathroom_fan_switch') == 'on' %} вытяжка. {% endif %}
- {% if states('light.bathroom_lights') == 'on' %} освещение {% endif %} {% else %} всё выключено {% endif %}.
- На кухне {% if states('light.kitchen_lights') == 'on' or states('light.kitchen') == 'on' or states('water_heater.kettle_rk_m171s') == 'electric' or states('climate.terneo_2') == 'heat' %} включены следующие устройства
- {% if states('light.kitchen_lights') == 'on' %} люстра. {% endif %} {% if states('light.kitchen') == 'on' %} подсветка пола. {% endif %}
- {% if states('light.sonoff_100079c574') == 'on' %} лента под потолком. {% endif %}
- {% if states('water_heater.kettle_rk_m171s') == 'electric' %} чайник. {% endif %}
- {% if states('climate.terneo_2') == 'heat' %} теплый пол настроен на температуру {{state_attr('climate.terneo_2', 'temperature') | int }} °C {% endif %} {% else %} всё выключено {% endif %}.
- В коридоре {% if states('switch.hallway_sw_switch_left') == 'on' %} включен свет {% else %} всё выключено {% endif %}
- {% endif %}
- # consumption: # воды за день | воды за неделю | воды за месяц | воды за год | воды за всё время | электричества за день | электричества за неделю | электричества за месяц | электричества за год | электричества за всё время
- # speech:
- # text: >-
- # {% if interval == 'воды за день' %}
- # За сегодня потрачено холодной воды. {{ states("sensor.24_cold") }} литров, а горячей. {{ states("sensor.24_hot") }} литров.
- # {% if interval == 'воды за месяц' %}
- # За месяц потрачено холодной воды. {{ states("counter.30_cold_water") }} литров, а горячей. {{ states("counter.30_hot_water") }} литров.
- # {% elif interval == 'за всё время' %}
- # Зачитываю показания счетчиков. Холодная вода. {{ states("counter.cnt_cold_water") }} литров. Горячая вода. {{ states("counter.cnt_hot_water") }} литров.
- # {% endif %}
- #############################################################
- # SCRIPT #
- #############################################################
- script:
- '1_11128':
- alias: TTS Температура в спальне
- mode: single
- sequence:
- - data_template:
- message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11129':
- alias: TTS Температура в ванной
- mode: single
- sequence:
- - data_template:
- message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11130':
- alias: TTS Температура на кухне
- mode: single
- sequence:
- - data_template:
- message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11131':
- alias: TTS Влажность в спальне
- mode: single
- sequence:
- - data_template:
- message: Влажность в спальне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Влажность в спальне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11132':
- alias: TTS Влажность в ванной
- mode: single
- sequence:
- - data_template:
- message: Влажность в ванной {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Влажность в ванной {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11133':
- alias: TTS Влажность на кухне
- mode: single
- sequence:
- - data_template:
- message: Влажность на кухне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Влажность на кухне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11134':
- alias: TTS Климат в спальне
- mode: single
- sequence:
- - data_template:
- message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round
- }} °C, а влажность {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round
- }} °C, а влажность {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11135':
- alias: TTS Климат в ванной
- mode: single
- sequence:
- - data_template:
- message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round
- }} °C а влажность {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round
- }} °C а влажность {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11136':
- alias: TTS Климат на кухне
- mode: single
- sequence:
- - data_template:
- message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round
- }} °C а влажность {{ states("sensor.kitchen_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round
- }} °C а влажность {{ states("sensor.kitchen_temp_humidity_humidity")|round }} %.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11137':
- alias: TTS Климат в квартире
- mode: single
- sequence:
- - data_template:
- message: Сейчас расскажу о климате в квартире.
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Сейчас расскажу о климате в квартире.
- entity_id: media_player.yandex_station
- service: tts.alice_say
- '1_11138':
- alias: TTS Климат дома
- mode: single
- sequence:
- - data: {}
- service: script.1_11134
- - delay: 00:02
- - data: {}
- service: script.1_11135
- - delay: 00:02
- - data: {}
- service: script.1_11136
- '1_11139':
- alias: Звонок в дверь
- mode: single
- sequence:
- - data_template:
- message: Кто-то пришел. Пойди проверь!
- entity_id: media_player.yandex_station_mini
- service: tts.alice_say
- - data_template:
- message: Кто-то пришел. Пойди проверь!
- entity_id: media_player.yandex_station
- service: tts.alice_say
- yandex_timer:
- alias: Установить таймер
- sequence:
- - service: media_player.play_media
- entity_id: media_player.yandex_station
- data_template:
- media_content_id: Включи свет в {{ states('input_datetime.alice_timer')[:5] }}
- media_content_type: command
- '1_11140':
- alias: Звонок на станцию
- sequence:
- - service: media_player.volume_set
- data:
- volume_level: 0
- entity_id: media_player.yandex_station
- - delay: '00:00:05'
- - service: media_player.play_media
- data:
- media_content_id: Сними трубку
- media_content_type: command
- entity_id: media_player.yandex_station
- - delay: '00:00:01'
- - service: media_player.volume_set
- data:
- volume_level: 0.5
- entity_id: media_player.yandex_station
- mode: single
- icon: 'mdi:phone-classic'
- '1_11141':
- alias: Звонок на станцию мини
- sequence:
- - service: media_player.volume_set
- data:
- volume_level: 0
- entity_id: media_player.yandex_station_mini
- - delay: '00:00:05'
- - service: media_player.play_media
- data:
- media_content_id: Сними трубку
- media_content_type: command
- entity_id: media_player.yandex_station_mini
- - delay: '00:00:01'
- - service: media_player.volume_set
- data:
- volume_level: 0.5
- entity_id: media_player.yandex_station_mini
- mode: single
- icon: 'mdi:phone-classic'
- #############################################################
- # SENSOR #
- #############################################################
- sensor:
- - platform: template
- sensors:
- alice_state:
- value_template: "{{ state_attr('media_player.yandex_station', 'alice_state') }}"
- - platform: template
- sensors:
- alice_mini_state:
- value_template: "{{ state_attr('media_player.yandex_station_mini', 'alice_state') }}"
- - platform: template
- sensors:
- alice_mini_last_changed:
- value_template: "{{relative_time(states.sensor.alice_mini_state.last_changed)}}"
- - platform: template
- sensors:
- alice_last_changed:
- value_template: "{{relative_time(states.sensor.alice_state.last_changed)}}"
- - platform: template
- sensors:
- alice_mini_music_state:
- value_template: "{{states('media_player.yandex_station_mini')}}"
- - platform: template
- sensors:
- alice_music_state:
- value_template: "{{states('media_player.yandex_station')}}"
- - platform: template
- sensors:
- alice_mini_music_last_changed:
- value_template: "{{relative_time(states.sensor.alice_mini_music_state.last_changed)}}"
- - platform: template
- sensors:
- alice_music_last_changed:
- value_template: "{{relative_time(states.sensor.alice_music_state.last_changed)}}"
- #############################################################
- # INPUT_BOOLEAN #
- #############################################################
- input_boolean:
- atv_switch:
- name: Телевизор
- initial: off
- first_in_the_morning:
- name: Первый человек
- initial: on
- silence_30_min:
- name: Молчим полчаса
- initial: off
- #############################################################
- # AUTOMATION #
- #############################################################
- automation:
- - id: '00000001'
- alias: Последняя активная станция в спальне
- description: ''
- trigger:
- platform: state
- entity_id: media_player.yandex_station
- attribute: alice_state
- to: LISTENING
- action:
- service: input_text.set_value
- entity_id: input_text.last_active
- data:
- value: media_player.yandex_station
- - id: '00000002'
- alias: Последняя активная станция на кухне
- description: ''
- trigger:
- platform: state
- entity_id: media_player.yandex_station_mini
- attribute: alice_state
- to: LISTENING
- action:
- service: input_text.set_value
- entity_id: input_text.last_active
- data:
- value: media_player.yandex_station_mini
Advertisement
Add Comment
Please, Sign In to add comment