НВ
Size: a a a
НВ
Р
Р
ДЦ
VP
VP
ДЦ
Р
Р
VP
VP
Р
Р
VP
VP
VP
Р
Р
# ##################################
# System - Sasha tracker - Audio
# ##################################
- alias: system_sasha_audio_tts
initial_state: 'on'
trigger:
platform: state
entity_id: input_boolean.sasha_tracker
#from: 'on'
#to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '07:00:00'
before: '21:00:00'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.switch_158d0001ef6089.last_updated) < 20 }}'
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.mpd
volume_level: '0.3'
- service: tts.yandextts_say
entity_id: media_player.mpd
data_template:
message: >
{% set name1 = ['С+аша, ','Сан+ёк, ','Алекс+андр, ','М+итрич, ','Алекс+андр Дм+итриевич, '] | random %}
{% set greet2 = ['пок+а!','до свид+ания!','до встр+ечи!','чава-как+ава!','всег+о хор+ошего!'] | random %}
{% set greet1 = ['прив+ет!','здар+ова!','здр+авствуй!','здр+авия жел+аю!','сал+ют!'] | random %}
{{name1}} {% if is_state('input_boolean.sasha_tracker','on')%}{{greet1}}{%else%}{{greet2}}{%endif%}
- service: notify.telegram
data_template:
message: "\U0001F476 Санек {%if is_state('input_boolean.sasha_tracker','on')%}дома{%else%}уходит{%endif%}!"
ДЦ
F