Guest User

Untitled

a guest
Dec 8th, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.05 KB | None | 0 0
  1.  
  2. #############################################################
  3. # #
  4. # /.\ '|| |''||''|.|'''','||''''| #
  5. # // \\ || || || || . #
  6. # //...\\ || || || ||'''| #
  7. # // \\ || || || || #
  8. # .// \\.||...|..||..|`|....'.||....| #
  9. # #
  10. #############################################################
  11.  
  12. yandex_dialogs:
  13. name: Диалог
  14. allowed_user_ids:
  15. - 4B1C7FB***************************************
  16.  
  17. yandex_smart_home_fix:
  18.  
  19. yandex_station:
  20. username: !secret yandexid
  21. password: !secret yandexpass
  22. tts_service_name: alice_say
  23. intents:
  24. Да: хорошо
  25. Тест:
  26. Включи:
  27. Открой:
  28. Покажи кто там:
  29.  
  30.  
  31. input_text:
  32. last_active:
  33. name: Активная станция
  34.  
  35. conversation:
  36. intents:
  37. media_player.yandex_station: [.+]
  38. #media_player.yandex_station_mini: [.+]
  39.  
  40. yandex_smart_home:
  41. filter:
  42. include_domains:
  43. - switch
  44. - light
  45. - climate
  46. include_entities:
  47. - script.1_0000000
  48. - media_player.yandex_intents
  49. - script.apple_tv_off
  50. - water_heater.kettle_rk_m171s
  51. - cover.curtain_cover
  52. - script.1591727180842
  53. - script.1_1111111111
  54. - script.1593116198914
  55. - script.1_11123
  56. - script.1_11124
  57. - script.1_11125
  58. - script.1_11126
  59. - script.1_11128
  60. - script.1_11129
  61. - script.1_11130
  62. - script.1_11131
  63. - script.1_11132
  64. - script.1_11133
  65. - script.1_11134
  66. - script.1_11135
  67. - script.1_11136
  68. - script.1_11137
  69. - script.1_11138
  70. - script.1111111111
  71. - script.1_11212
  72. - script.1_11213
  73. - input_boolean.atv_switch
  74. - script.atv_kinopoick
  75. - script.atv_youtube
  76. - script.skip_ad
  77. - script.low_brightness_tv
  78. - script.high_brightness_tv
  79. - script.game_mode_tv_off
  80. - script.game_mode_tv_on
  81.  
  82. exclude_entities:
  83. - light.bedroom_tradfri_1
  84. - light.bedroom_tradfri_2
  85. - light.bedroom_tradfri_3
  86. - light.bedroom_tradfri_4
  87. - light.bedroom_tradfri_5
  88. - light.bath_tradfri_1
  89. - light.bath_tradfri_2
  90. - light.bath_tradfri_3
  91. - light.kitchen_tradfri_1
  92. - light.kitchen_tradfri_2
  93. - light.kitchen_tradfri_3
  94. - light.kitchen_tradfri_4
  95. - light.kitchen_tradfri_5
  96. - light.kitchen_tradfri_6
  97. - light.kitchen_leds
  98. - switch.zigbee2mqtt_main_join
  99. - switch.asus
  100. - switch.xiaomi_airpurifier_buzzer
  101. - switch.xiaomi_airpurifier_child_lock
  102. - switch.xiaomi_airpurifier_led
  103. - climate.terneo_2
  104. - switch.sonoff_1000745226
  105. - switch.hallway_sw_right
  106.  
  107. input_datetime:
  108. alice_timer:
  109. name: Время таймера
  110. has_date: false
  111. has_time: true
  112.  
  113. #############################################################
  114. # INTENTS #
  115. #############################################################
  116.  
  117. intent_script:
  118. yandex_default:
  119. action:
  120. - service: persistent_notification.create
  121. data:
  122. title: Команда из Яндекса
  123. message: "{{ text }}"
  124. speech:
  125. text: >-
  126. {% if text == 'привет' %}
  127. {{ ['слушаю', 'здесь я', 'на связи']|random }}
  128. {% elif text == 'какая температура в спальне' %}
  129. Температура {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C
  130. {% elif text == 'какая температура в ванной' %}
  131. Температура {{ states("sensor.bath_temp_humidity_temperature")|round }} °C
  132. {% elif text == 'какая температура на кухне' %}
  133. Температура {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C
  134. {% else %}
  135. Не могу выполнить: {{ text }}
  136. {% endif %}
  137.  
  138. calc:
  139. action:
  140. - service: persistent_notification.create
  141. data_template:
  142. title: Яндекс Калькулятор
  143. message: "{{ text }}"
  144. speech:
  145. text: >-
  146. {% if action == 'плюс' %}
  147. {{ x+y }}
  148. {% elif action == 'минус' %}
  149. {{ x-y }}
  150. {% elif action == 'умножить на' %}
  151. {{ x*y }}
  152. {% elif action == 'разделить на' %}
  153. {{ x/y }}
  154. {% endif %}
  155.  
  156. temperature:
  157. speech:
  158. text: >-
  159. {% if room == 'в спальне' %}
  160. Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C
  161. {% elif room == 'в ванной' %}
  162. Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C
  163. {% elif room == 'на кухне' %}
  164. Температура на кухне {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C
  165. {% elif room == 'дома' %}
  166. Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C,
  167. в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C,
  168. на кухне {{ states("sensor.kitchen_temp_humidity_temperature")|round }} °C,
  169. теплый пол {% if states('climate.terneo_2') == 'heat' %} включен {% else %} выключен {% endif %},
  170. кондиционер {% if states('binary_sensor.ac_status') == 'on' %} включен {% else %} выключен {% endif %},
  171. вытяжка в ванной {% if states('switch.bathroom_fan_switch') == 'on' %} включена {% else %} выключена {% endif %}
  172. {% endif %}
  173.  
  174. state:
  175. speech:
  176. text: >-
  177. {% if room == 'в спальне' or room == 'спальни' %}
  178. . В спальне включены следующие устройства {% if states('light.bedroom_lights') == 'on' %} люстра. {% endif %}
  179. {% if states('switch.bed_led_switch') == 'on' %} подсветка кровати. {% endif %}
  180. {% if states('light.bedroom') == 'on' %} подсветка тумбы. {% endif %}
  181. {% if states('switch.balcony_light_switch') == 'on' %} подсветка балкона. {% endif %}
  182. {% if states('binary_sensor.ac_status') == 'on' %} кондиционер. {% endif %}
  183. {% if states('media_player.samsung_tv_remote') == 'on' %} телевизор. {% endif %}
  184. {% if (state_attr('fan.purifier', 'motor_speed')) > '800' | int%}очиститель.{% endif %}
  185. шторы{% if states('cover.curtain_cover') == 'open' %} открыты {% else %} закрыты {% endif %}
  186. {% elif room == 'в ванной' or room == 'ванной' %}
  187. . В ванной {% if states('switch.bathroom_fan_switch') == 'on' or states('light.bathroom_lights') == 'on' %}
  188. включены следующие устройства {% if states('switch.bathroom_fan_switch') == 'on' %} вытяжка. {% endif %}
  189. {% if states('light.bathroom_lights') == 'on' %} освещение {% endif %}
  190. {% else %} всё выключено {% endif %}
  191. {% elif room == 'на кухне' or room == 'кухни' %}
  192. . На кухне {% if states('light.kitchen_lights') == 'on' or states('light.kitchen') == 'on'
  193. or states('water_heater.kettle_rk_m171s') == 'electric' or states('climate.terneo_2') == 'heat' %} включены следующие устройства
  194. {% if states('light.kitchen_lights') == 'on' %} люстра. {% endif %} {% if states('light.kitchen') == 'on' %} подсветка пола. {% endif %}
  195. {% if states('light.sonoff_100079c574') == 'on' %} лента под потолком. {% endif %} {% if states('water_heater.kettle_rk_m171s') == 'electric' %} чайник. {% endif %}
  196. {% if states('climate.terneo_2') == 'heat' %} теплый пол настроен на температуру {{state_attr('climate.terneo_2', 'temperature') | int }} °C {% endif %}
  197. {% else %} всё выключено {% endif %}
  198. {% elif room == 'дома' %}
  199. . В спальне включены следующие устройства. {% if states('light.bedroom_lights') == 'on' %} люстра. {% endif %}
  200. {% if states('switch.bed_led_switch') == 'on' %} подсветка кровати. {% endif %}
  201. {% if states('light.bedroom') == 'on' %} подсветка тумбы. {% endif %}
  202. {% if states('switch.balcony_light_switch') == 'on' %} подсветка балкона. {% endif %}
  203. {% if states('binary_sensor.ac_status') == 'on' %} кондиционер. {% endif %}
  204. {% if states('media_player.samsung_tv_remote') == 'on' %} телевизор. {% endif %}
  205. {% if (state_attr('fan.purifier', 'motor_speed')) > '800' | int%}очиститель.{% endif %}
  206. шторы{% if states('cover.curtain_cover') == 'open' %} открыты {% else %} закрыты {% endif %}.
  207. В ванной {% if states('switch.bathroom_fan_switch') == 'on' or states('light.bathroom_lights') == 'on' %} включены следующие устройства
  208. {% if states('switch.bathroom_fan_switch') == 'on' %} вытяжка. {% endif %}
  209. {% if states('light.bathroom_lights') == 'on' %} освещение {% endif %} {% else %} всё выключено {% endif %}.
  210. На кухне {% 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' %} включены следующие устройства
  211. {% if states('light.kitchen_lights') == 'on' %} люстра. {% endif %} {% if states('light.kitchen') == 'on' %} подсветка пола. {% endif %}
  212. {% if states('light.sonoff_100079c574') == 'on' %} лента под потолком. {% endif %}
  213. {% if states('water_heater.kettle_rk_m171s') == 'electric' %} чайник. {% endif %}
  214. {% if states('climate.terneo_2') == 'heat' %} теплый пол настроен на температуру {{state_attr('climate.terneo_2', 'temperature') | int }} °C {% endif %} {% else %} всё выключено {% endif %}.
  215. В коридоре {% if states('switch.hallway_sw_switch_left') == 'on' %} включен свет {% else %} всё выключено {% endif %}
  216. {% endif %}
  217.  
  218. # consumption: # воды за день | воды за неделю | воды за месяц | воды за год | воды за всё время | электричества за день | электричества за неделю | электричества за месяц | электричества за год | электричества за всё время
  219. # speech:
  220. # text: >-
  221. # {% if interval == 'воды за день' %}
  222. # За сегодня потрачено холодной воды. {{ states("sensor.24_cold") }} литров, а горячей. {{ states("sensor.24_hot") }} литров.
  223. # {% if interval == 'воды за месяц' %}
  224. # За месяц потрачено холодной воды. {{ states("counter.30_cold_water") }} литров, а горячей. {{ states("counter.30_hot_water") }} литров.
  225. # {% elif interval == 'за всё время' %}
  226. # Зачитываю показания счетчиков. Холодная вода. {{ states("counter.cnt_cold_water") }} литров. Горячая вода. {{ states("counter.cnt_hot_water") }} литров.
  227. # {% endif %}
  228.  
  229.  
  230. #############################################################
  231. # SCRIPT #
  232. #############################################################
  233. script:
  234. '1_11128':
  235. alias: TTS Температура в спальне
  236. mode: single
  237. sequence:
  238. - data_template:
  239. message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
  240. entity_id: media_player.yandex_station_mini
  241. service: tts.alice_say
  242. - data_template:
  243. message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
  244. entity_id: media_player.yandex_station
  245. service: tts.alice_say
  246. '1_11129':
  247. alias: TTS Температура в ванной
  248. mode: single
  249. sequence:
  250. - data_template:
  251. message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C.
  252. entity_id: media_player.yandex_station_mini
  253. service: tts.alice_say
  254. - data_template:
  255. message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round }} °C.
  256. entity_id: media_player.yandex_station
  257. service: tts.alice_say
  258. '1_11130':
  259. alias: TTS Температура на кухне
  260. mode: single
  261. sequence:
  262. - data_template:
  263. message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
  264. entity_id: media_player.yandex_station_mini
  265. service: tts.alice_say
  266. - data_template:
  267. message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round }} °C.
  268. entity_id: media_player.yandex_station
  269. service: tts.alice_say
  270. '1_11131':
  271. alias: TTS Влажность в спальне
  272. mode: single
  273. sequence:
  274. - data_template:
  275. message: Влажность в спальне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  276. entity_id: media_player.yandex_station_mini
  277. service: tts.alice_say
  278. - data_template:
  279. message: Влажность в спальне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  280. entity_id: media_player.yandex_station
  281. service: tts.alice_say
  282. '1_11132':
  283. alias: TTS Влажность в ванной
  284. mode: single
  285. sequence:
  286. - data_template:
  287. message: Влажность в ванной {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
  288. entity_id: media_player.yandex_station_mini
  289. service: tts.alice_say
  290. - data_template:
  291. message: Влажность в ванной {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
  292. entity_id: media_player.yandex_station
  293. service: tts.alice_say
  294. '1_11133':
  295. alias: TTS Влажность на кухне
  296. mode: single
  297. sequence:
  298. - data_template:
  299. message: Влажность на кухне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  300. entity_id: media_player.yandex_station_mini
  301. service: tts.alice_say
  302. - data_template:
  303. message: Влажность на кухне {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  304. entity_id: media_player.yandex_station
  305. service: tts.alice_say
  306. '1_11134':
  307. alias: TTS Климат в спальне
  308. mode: single
  309. sequence:
  310. - data_template:
  311. message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round
  312. }} °C, а влажность {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  313. entity_id: media_player.yandex_station_mini
  314. service: tts.alice_say
  315. - data_template:
  316. message: Температура в спальне {{ states("sensor.bedroom_temp_humidity_temperature")|round
  317. }} °C, а влажность {{ states("sensor.bedroom_temp_humidity_humidity")|round }} %.
  318. entity_id: media_player.yandex_station
  319. service: tts.alice_say
  320. '1_11135':
  321. alias: TTS Климат в ванной
  322. mode: single
  323. sequence:
  324. - data_template:
  325. message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round
  326. }} °C а влажность {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
  327. entity_id: media_player.yandex_station_mini
  328. service: tts.alice_say
  329. - data_template:
  330. message: Температура в ванной {{ states("sensor.bath_temp_humidity_temperature")|round
  331. }} °C а влажность {{ states("sensor.bath_temp_humidity_humidity")|round }} %.
  332. entity_id: media_player.yandex_station
  333. service: tts.alice_say
  334. '1_11136':
  335. alias: TTS Климат на кухне
  336. mode: single
  337. sequence:
  338. - data_template:
  339. message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round
  340. }} °C а влажность {{ states("sensor.kitchen_temp_humidity_humidity")|round }} %.
  341. entity_id: media_player.yandex_station_mini
  342. service: tts.alice_say
  343. - data_template:
  344. message: Температура на кухне {{ states("sensor.bedroom_temp_humidity_temperature")|round
  345. }} °C а влажность {{ states("sensor.kitchen_temp_humidity_humidity")|round }} %.
  346. entity_id: media_player.yandex_station
  347. service: tts.alice_say
  348. '1_11137':
  349. alias: TTS Климат в квартире
  350. mode: single
  351. sequence:
  352. - data_template:
  353. message: Сейчас расскажу о климате в квартире.
  354. entity_id: media_player.yandex_station_mini
  355. service: tts.alice_say
  356. - data_template:
  357. message: Сейчас расскажу о климате в квартире.
  358. entity_id: media_player.yandex_station
  359. service: tts.alice_say
  360. '1_11138':
  361. alias: TTS Климат дома
  362. mode: single
  363. sequence:
  364. - data: {}
  365. service: script.1_11134
  366. - delay: 00:02
  367. - data: {}
  368. service: script.1_11135
  369. - delay: 00:02
  370. - data: {}
  371. service: script.1_11136
  372. '1_11139':
  373. alias: Звонок в дверь
  374. mode: single
  375. sequence:
  376. - data_template:
  377. message: Кто-то пришел. Пойди проверь!
  378. entity_id: media_player.yandex_station_mini
  379. service: tts.alice_say
  380. - data_template:
  381. message: Кто-то пришел. Пойди проверь!
  382. entity_id: media_player.yandex_station
  383. service: tts.alice_say
  384. yandex_timer:
  385. alias: Установить таймер
  386. sequence:
  387. - service: media_player.play_media
  388. entity_id: media_player.yandex_station
  389. data_template:
  390. media_content_id: Включи свет в {{ states('input_datetime.alice_timer')[:5] }}
  391. media_content_type: command
  392. '1_11140':
  393. alias: Звонок на станцию
  394. sequence:
  395. - service: media_player.volume_set
  396. data:
  397. volume_level: 0
  398. entity_id: media_player.yandex_station
  399. - delay: '00:00:05'
  400. - service: media_player.play_media
  401. data:
  402. media_content_id: Сними трубку
  403. media_content_type: command
  404. entity_id: media_player.yandex_station
  405. - delay: '00:00:01'
  406. - service: media_player.volume_set
  407. data:
  408. volume_level: 0.5
  409. entity_id: media_player.yandex_station
  410. mode: single
  411. icon: 'mdi:phone-classic'
  412. '1_11141':
  413. alias: Звонок на станцию мини
  414. sequence:
  415. - service: media_player.volume_set
  416. data:
  417. volume_level: 0
  418. entity_id: media_player.yandex_station_mini
  419. - delay: '00:00:05'
  420. - service: media_player.play_media
  421. data:
  422. media_content_id: Сними трубку
  423. media_content_type: command
  424. entity_id: media_player.yandex_station_mini
  425. - delay: '00:00:01'
  426. - service: media_player.volume_set
  427. data:
  428. volume_level: 0.5
  429. entity_id: media_player.yandex_station_mini
  430. mode: single
  431. icon: 'mdi:phone-classic'
  432.  
  433.  
  434.  
  435. #############################################################
  436. # SENSOR #
  437. #############################################################
  438. sensor:
  439. - platform: template
  440. sensors:
  441. alice_state:
  442. value_template: "{{ state_attr('media_player.yandex_station', 'alice_state') }}"
  443. - platform: template
  444. sensors:
  445. alice_mini_state:
  446. value_template: "{{ state_attr('media_player.yandex_station_mini', 'alice_state') }}"
  447. - platform: template
  448. sensors:
  449. alice_mini_last_changed:
  450. value_template: "{{relative_time(states.sensor.alice_mini_state.last_changed)}}"
  451. - platform: template
  452. sensors:
  453. alice_last_changed:
  454. value_template: "{{relative_time(states.sensor.alice_state.last_changed)}}"
  455. - platform: template
  456. sensors:
  457. alice_mini_music_state:
  458. value_template: "{{states('media_player.yandex_station_mini')}}"
  459. - platform: template
  460. sensors:
  461. alice_music_state:
  462. value_template: "{{states('media_player.yandex_station')}}"
  463. - platform: template
  464. sensors:
  465. alice_mini_music_last_changed:
  466. value_template: "{{relative_time(states.sensor.alice_mini_music_state.last_changed)}}"
  467. - platform: template
  468. sensors:
  469. alice_music_last_changed:
  470. value_template: "{{relative_time(states.sensor.alice_music_state.last_changed)}}"
  471.  
  472.  
  473. #############################################################
  474. # INPUT_BOOLEAN #
  475. #############################################################
  476.  
  477. input_boolean:
  478. atv_switch:
  479. name: Телевизор
  480. initial: off
  481. first_in_the_morning:
  482. name: Первый человек
  483. initial: on
  484. silence_30_min:
  485. name: Молчим полчаса
  486. initial: off
  487.  
  488.  
  489.  
  490. #############################################################
  491. # AUTOMATION #
  492. #############################################################
  493.  
  494. automation:
  495. - id: '00000001'
  496. alias: Последняя активная станция в спальне
  497. description: ''
  498. trigger:
  499. platform: state
  500. entity_id: media_player.yandex_station
  501. attribute: alice_state
  502. to: LISTENING
  503. action:
  504. service: input_text.set_value
  505. entity_id: input_text.last_active
  506. data:
  507. value: media_player.yandex_station
  508. - id: '00000002'
  509. alias: Последняя активная станция на кухне
  510. description: ''
  511. trigger:
  512. platform: state
  513. entity_id: media_player.yandex_station_mini
  514. attribute: alice_state
  515. to: LISTENING
  516. action:
  517. service: input_text.set_value
  518. entity_id: input_text.last_active
  519. data:
  520. value: media_player.yandex_station_mini
  521.  
Advertisement
Add Comment
Please, Sign In to add comment