2730 lines
85 KiB
YAML
2730 lines
85 KiB
YAML
- id: alarm_play_loop
|
||
alias: Alarm - play loop
|
||
description: Alarm Widergabe
|
||
mode: single
|
||
triggers:
|
||
- trigger: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.alarm_indoor
|
||
- trigger: state
|
||
entity_id: input_boolean.alarm_indoor
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.alarm_indoor
|
||
state: 'on'
|
||
actions:
|
||
- action: script.alarm_play
|
||
- action: timer.start
|
||
data:
|
||
duration: 0:00:05
|
||
target:
|
||
entity_id: timer.alarm_indoor
|
||
- id: alarm_play_stop
|
||
alias: Alarm - play stop
|
||
description: Alarm stoppen
|
||
mode: single
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_boolean.alarm_indoor
|
||
from: 'on'
|
||
to: 'off'
|
||
actions:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.garage_siren_on_event
|
||
- action: timer.finish
|
||
target:
|
||
entity_id: timer.alarm_indoor
|
||
- action: media_player.media_stop
|
||
target:
|
||
entity_id: media_player.home_group
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: script.alarm_play
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.home_group
|
||
data:
|
||
volume_level: 0.2
|
||
- id: alarm_notify
|
||
alias: Alarm - Notify
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_boolean.alarm_indoor
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- alias: Repeat a few times
|
||
repeat:
|
||
count: 4
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚨👮🆘 Alarm aufgelöst!!!
|
||
message: Etwas passiert!!!
|
||
- delay: 00:00:05
|
||
- id: telegram_alarm
|
||
alias: Telegram - Alarm toggle
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /alarm
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /alarm
|
||
actions:
|
||
- action: switch.toggle
|
||
data:
|
||
entity_id: switch.alarm_play
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: switch.alarm_play
|
||
timeout: 5
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 🚨 {{ state_attr('switch.alarm_play', 'friendly_name') }} - {{ states('switch.alarm_play')
|
||
}}
|
||
- id: tasmota_state_on_startup
|
||
alias: Tasmota - Power state on HA startup
|
||
triggers:
|
||
- event: start
|
||
trigger: homeassistant
|
||
actions:
|
||
- action: mqtt.publish
|
||
data:
|
||
payload: '1'
|
||
topic: sonoffs/cmnd/state
|
||
- action: mqtt.publish
|
||
data:
|
||
payload: '1'
|
||
topic: sonoffs/tele/STATE
|
||
- id: rolladen_auf
|
||
alias: Rolladen - Auf
|
||
description: ''
|
||
triggers:
|
||
- event: sunrise
|
||
offset: 03:00:00
|
||
trigger: sun
|
||
conditions: []
|
||
actions:
|
||
- data:
|
||
entity_id: cover.rolladen
|
||
position: 100
|
||
action: cover.set_cover_position
|
||
- data:
|
||
message: Rolladen geöffnet
|
||
title: 🔼 Rolladen
|
||
action: notify.telegram_schick_home
|
||
mode: single
|
||
- id: rolladen_zu
|
||
alias: Rolladen - Zu
|
||
description: ''
|
||
triggers:
|
||
- event: sunset
|
||
offset: 01:30:00
|
||
trigger: sun
|
||
conditions: []
|
||
actions:
|
||
- data:
|
||
entity_id: cover.rolladen
|
||
position: 0
|
||
action: cover.set_cover_position
|
||
- data:
|
||
message: Rolladen geschlossen
|
||
title: 🔽 Rolladen
|
||
action: notify.telegram_schick_home
|
||
mode: single
|
||
- id: garagenlicht_einschalten
|
||
alias: Garage - Licht einschalten
|
||
description: Garagenlicht einschalten nach der Sonnenunregang oder wenn es dunkel
|
||
ist
|
||
triggers:
|
||
- type: value
|
||
trigger: device
|
||
device_id: db8b13c767d84865a607aca77975a221
|
||
entity_id: sensor.torposition
|
||
domain: sensor
|
||
above: 40
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
milliseconds: 0
|
||
conditions:
|
||
- condition: or
|
||
conditions:
|
||
- condition: sun
|
||
before: sunrise
|
||
before_offset: 00:15:00
|
||
- condition: sun
|
||
after: sunset
|
||
after_offset: -00:15:00
|
||
actions:
|
||
- type: turn_on
|
||
device_id: 63713a671de1472e84d5832bcb399f0e
|
||
entity_id: light.sonoffbnsz01
|
||
domain: light
|
||
brightness_pct: 95
|
||
- delay:
|
||
hours: 0
|
||
minutes: 10
|
||
seconds: 0
|
||
milliseconds: 0
|
||
- type: turn_off
|
||
device_id: 63713a671de1472e84d5832bcb399f0e
|
||
entity_id: light.sonoffbnsz01
|
||
domain: light
|
||
mode: restart
|
||
- id: garagenlicht_ausschalten
|
||
alias: Garage - Licht ausschalten
|
||
description: Garagenlicht ausschalten wenn das Garagentor geschlossen wurde
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- binary_sensor.tor_ist_geschlossen
|
||
to: 'on'
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
- trigger: state
|
||
entity_id: input_boolean.torteil
|
||
to: 'on'
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
conditions: []
|
||
actions:
|
||
- type: turn_off
|
||
device_id: 63713a671de1472e84d5832bcb399f0e
|
||
entity_id: light.sonoffbnsz01
|
||
domain: light
|
||
mode: restart
|
||
- id: camera_garage_richtung
|
||
alias: Camera - Garage Richtung
|
||
description: Направление камеры в зависимости от положения гаражных ворот
|
||
triggers:
|
||
- type: value
|
||
trigger: device
|
||
device_id: db8b13c767d84865a607aca77975a221
|
||
entity_id: sensor.torposition
|
||
domain: sensor
|
||
above: 30
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
- type: value
|
||
trigger: device
|
||
device_id: db8b13c767d84865a607aca77975a221
|
||
entity_id: sensor.torposition
|
||
domain: sensor
|
||
below: 20
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
- trigger: state
|
||
entity_id:
|
||
- binary_sensor.tor_ist_geschlossen
|
||
to: 'on'
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 3
|
||
- trigger: state
|
||
entity_id: input_boolean.torteil
|
||
to: 'on'
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
conditions: []
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- type: is_value
|
||
condition: device
|
||
device_id: db8b13c767d84865a607aca77975a221
|
||
entity_id: sensor.torposition
|
||
domain: sensor
|
||
above: 30
|
||
sequence:
|
||
- action: select.select_option
|
||
data:
|
||
option: Tor
|
||
target:
|
||
entity_id: select.garage_ptz_preset
|
||
- conditions:
|
||
- type: is_value
|
||
condition: device
|
||
device_id: db8b13c767d84865a607aca77975a221
|
||
entity_id: sensor.tor_distanz
|
||
domain: sensor
|
||
below: 20
|
||
sequence:
|
||
- action: select.select_option
|
||
data:
|
||
option: Tuer
|
||
target:
|
||
entity_id: select.garage_ptz_preset
|
||
- delay:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 30
|
||
milliseconds: 0
|
||
- action: select.select_option
|
||
data:
|
||
option: Tuer
|
||
target:
|
||
entity_id: select.garage_ptz_preset
|
||
default: []
|
||
mode: restart
|
||
- id: '1661601350027'
|
||
alias: Считана метка Red
|
||
description: ''
|
||
triggers:
|
||
- trigger: tag
|
||
tag_id: 4d4d9d64-59ff-4a65-8d8c-d1a088f46599
|
||
conditions: []
|
||
actions:
|
||
- action: switch.toggle
|
||
data: {}
|
||
target:
|
||
entity_id: switch.tor
|
||
mode: single
|
||
- id: '1661607357549'
|
||
alias: Считана метка Green
|
||
description: ''
|
||
triggers:
|
||
- trigger: tag
|
||
tag_id: 25cf4f63-039d-47b6-8012-32e9e6cb831d
|
||
conditions: []
|
||
actions:
|
||
- action: light.toggle
|
||
data: {}
|
||
target:
|
||
entity_id: light.sonoffpow_01
|
||
mode: single
|
||
- id: '1668006470208'
|
||
alias: Garage - Coming home
|
||
description: Open tor if Tiguan is coming to home
|
||
triggers:
|
||
- device_id: d65b64c785a29ffed795c6d22780bb9f
|
||
domain: device_tracker
|
||
entity_id: e26c53c9fa2534a4da69f77b06f7414f
|
||
type: enters
|
||
trigger: device
|
||
zone: zone.home
|
||
conditions:
|
||
- condition: state
|
||
entity_id: sensor.as25_bluetooth_connection
|
||
attribute: connected_paired_devices
|
||
state: B4:EC:02:94:8A:CF (VW BT 1505)
|
||
enabled: false
|
||
- condition: numeric_state
|
||
entity_id: sensor.torposition
|
||
below: 15
|
||
- condition: or
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ "68:4E:05:63:56:10 (VOLKSWAGEN-21ED)" in state_attr("sensor.as25_bluetooth_connection",
|
||
"connected_paired_devices") }}'
|
||
- condition: template
|
||
value_template: '{{ "B4:EC:02:94:8A:CF (VW BT 1505)" in state_attr("sensor.as25_bluetooth_connection",
|
||
"connected_paired_devices") }}'
|
||
actions:
|
||
- data: {}
|
||
target:
|
||
entity_id: switch.tor
|
||
action: switch.turn_on
|
||
- data:
|
||
message: TTS
|
||
title: Garage
|
||
data:
|
||
ttl: 0
|
||
priority: high
|
||
media_stream: alarm_stream_max
|
||
tts_text: Die Garage öffnet
|
||
action: notify.mobile_app_as25
|
||
mode: single
|
||
- id: '1668017327174'
|
||
alias: Garage - Leaving home
|
||
description: Close tor if Tiguan is leaving home
|
||
triggers:
|
||
- device_id: d65b64c785a29ffed795c6d22780bb9f
|
||
domain: device_tracker
|
||
entity_id: e26c53c9fa2534a4da69f77b06f7414f
|
||
type: leaves
|
||
trigger: device
|
||
zone: zone.home
|
||
conditions:
|
||
- condition: state
|
||
entity_id: sensor.as25_bluetooth_connection
|
||
attribute: connected_paired_devices
|
||
state: B4:EC:02:94:8A:CF (VW BT 1505)
|
||
enabled: false
|
||
- condition: or
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ "68:4E:05:63:56:10 (VOLKSWAGEN-21ED)" in state_attr("sensor.as25_bluetooth_connection",
|
||
"connected_paired_devices") }}'
|
||
- condition: template
|
||
value_template: '{{ "B4:EC:02:94:8A:CF (VW BT 1505)" in state_attr("sensor.as25_bluetooth_connection",
|
||
"connected_paired_devices") }}'
|
||
- condition: numeric_state
|
||
entity_id: sensor.torposition
|
||
above: 15
|
||
actions:
|
||
- data: {}
|
||
target:
|
||
entity_id: switch.tor
|
||
action: switch.turn_on
|
||
- data:
|
||
message: TTS
|
||
title: Garage
|
||
data:
|
||
ttl: 0
|
||
priority: high
|
||
media_stream: alarm_stream_max
|
||
tts_text: Die Garage schlisst
|
||
action: notify.mobile_app_as25
|
||
- wait_for_trigger:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.torposition
|
||
for:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 5
|
||
below: 6
|
||
timeout:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 30
|
||
milliseconds: 0
|
||
continue_on_timeout: false
|
||
- data:
|
||
message: TTS
|
||
title: Garage
|
||
data:
|
||
ttl: 0
|
||
priority: high
|
||
media_stream: alarm_stream_max
|
||
tts_text: Die Garage ist geschlossen
|
||
action: notify.mobile_app_as25
|
||
mode: single
|
||
- id: 3d_prtint_is_done
|
||
alias: 3D - Druck ist fertig
|
||
description: ''
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- sensor.ender_3_s1_pro_current_print_state
|
||
for:
|
||
hours: 0
|
||
minutes: 10
|
||
seconds: 0
|
||
to: complete
|
||
conditions: []
|
||
actions:
|
||
- action: camera.snapshot
|
||
metadata: {}
|
||
data:
|
||
filename: /config/www/screenshots/3dprinter.jpg
|
||
target:
|
||
entity_id: camera.ender_3_s1_pro_sony
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
message: 🏭 3D Druck ist fertig
|
||
data:
|
||
photo:
|
||
- file: /config/www/screenshots/3dprinter.jpg
|
||
caption: 🏭 3D Druck ist fertig
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
message: 🏭 3D Druck ist fertig
|
||
data:
|
||
photo:
|
||
- url: '{{ state_attr(''sensor.ender_3_s1_pro_thumbnail'',''url'') }}'
|
||
caption: 🏭 3D Druck ist fertig
|
||
enabled: false
|
||
- wait_for_trigger:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.ender_3_s1_pro_extruder_temperature
|
||
below: 70
|
||
timeout:
|
||
hours: 0
|
||
minutes: 10
|
||
seconds: 0
|
||
milliseconds: 0
|
||
enabled: true
|
||
- if:
|
||
- condition: template
|
||
value_template: '{{ not is_state(''sensor.ender_3_s1_pro_current_print_state'',''printing'')
|
||
|
||
and not is_state(''sensor.ender_3_s1_pro_current_print_state'',''paused'')}}'
|
||
then:
|
||
- action: switch.turn_off
|
||
data: {}
|
||
target:
|
||
entity_id: switch.tuyaplug1
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
message: 🏭 3D Drucker ist ausgeschaltet
|
||
enabled: true
|
||
mode: single
|
||
- id: '1674336725023'
|
||
alias: Erinnerung - Mühlabfuhr
|
||
description: ''
|
||
use_blueprint:
|
||
path: westenberg/garbage-reminder.yaml
|
||
input:
|
||
garbage_sensor_1: sensor.restabfall
|
||
garbage_sensor_2: sensor.leichtverpackungen
|
||
garbage_sensor_3: sensor.papier
|
||
notifier: notify.telegram_schick_home
|
||
day_offset: '1'
|
||
reminder_time: '18:20:00'
|
||
reminder_message: 'Folgender Müll wird morgen abgeholt: '
|
||
reminder_title: 🗑️ Müllabfuhr Erinnerung
|
||
- id: '1694760290268'
|
||
alias: HASS - CleanUp stale devices
|
||
description: Remove all stale devices from Home Assistant
|
||
triggers:
|
||
- trigger: time
|
||
at: 00:00:00
|
||
conditions:
|
||
- condition: time
|
||
weekday:
|
||
- mon
|
||
actions:
|
||
- action: button.press
|
||
data: {}
|
||
target:
|
||
entity_id:
|
||
- button.fritz_box_5590_fiber_cleanup
|
||
- button.fritz_box_7590_ax_cleanup
|
||
- action: ble_monitor.cleanup_entries
|
||
data: {}
|
||
- action: tts.clear_cache
|
||
data: {}
|
||
mode: single
|
||
- id: '1704829899531'
|
||
alias: Aktualisierung
|
||
description: Aktualisierungsbenachrichtigung
|
||
use_blueprint:
|
||
path: mdegat01/update_notifications.yaml
|
||
input:
|
||
update_entities:
|
||
- update.einfahrt_update
|
||
- update.esphome_update
|
||
- update.fritz_box_5590_fiber_fritz_os
|
||
- update.ftp_update
|
||
- update.garage_update
|
||
- update.garagegate_firmware
|
||
- update.home_assistant_core_update
|
||
- update.home_assistant_supervisor_update
|
||
- update.markise_firmware
|
||
- update.mosquitto_broker_update
|
||
- update.nginx_home_assistant_ssl_proxy_update
|
||
- update.pi_hole_v6_integration_update
|
||
- update.pi_hole_core_update_available
|
||
- update.pi_hole_ftl_update_available
|
||
- update.samba_share_update
|
||
- update.sqlite_web_update
|
||
- update.studio_code_server_update
|
||
- update.tasmoadmin_update
|
||
- update.terminal_ssh_update
|
||
- update.terrasse_update
|
||
- update.innen_firmware
|
||
- update.matter_server_update
|
||
- update.vlc_update
|
||
- update.fritz_box_7590_ax_fritz_os
|
||
- update.music_assistant_server_update
|
||
- update.shelly1pmminig3_34b7da8db254_firmware_update
|
||
- update.aha_region_update
|
||
- update.bar_card_update
|
||
- update.card_tools_update
|
||
- update.comfortable_environment_card_update
|
||
- update.firmware_update
|
||
- update.fold_entity_row_update
|
||
- update.go2rtc_update
|
||
- update.hacs_update
|
||
- update.landroid_card_update
|
||
- update.landroid_cloud_update
|
||
- update.let_s_encrypt_update
|
||
- update.local_tuya_update
|
||
- update.mini_media_player_update
|
||
- update.mini_graph_card_update
|
||
- update.moonraker_update
|
||
- update.mushroom_themes_update
|
||
- update.passive_ble_monitor_integration_update
|
||
- update.polr_ytube_media_card_update
|
||
- update.restriction_card_update
|
||
- update.samsung_soundbar_update
|
||
- update.slider_button_card_update
|
||
- update.slider_entity_row_update
|
||
- update.spook_your_homie_update
|
||
- update.thermal_comfort_icons_update
|
||
- update.thermal_comfort_update
|
||
- update.vacuum_card_update
|
||
- update.weather_chart_card_update
|
||
- update.webrtc_camera_update
|
||
- update.xiaomi_mi_smart_pedestal_fan_integration_update
|
||
- update.xiaomi_smartmi_fan_card_update
|
||
- update.xiaomi_vacuum_map_card_update
|
||
- update.yandex_smart_home_update
|
||
- update.yandex_station_intents_update
|
||
- update.yandex_station_update
|
||
- update.ytube_music_player_update
|
||
- update.pi_hole_web_update_available
|
||
- update.maxi_media_player_update
|
||
- update.samsungtv_smart_update
|
||
- update.seitenmarkise_74aab6_firmware
|
||
mobile_app_device: d65b64c785a29ffed795c6d22780bb9f
|
||
reminder_hours: '6'
|
||
run_config_check: true
|
||
send_to_ha: true
|
||
mobile_app_device_2: d65b64c785a29ffed795c6d22780bb9f
|
||
- id: camera_manage_status_led
|
||
alias: Camera - Manage status LED
|
||
triggers:
|
||
- trigger: sun
|
||
event: sunrise
|
||
id: sunrise
|
||
- trigger: sun
|
||
event: sunset
|
||
id: sunset
|
||
conditions: []
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id:
|
||
- sunrise
|
||
sequence:
|
||
- action: light.turn_on
|
||
metadata: {}
|
||
data: {}
|
||
target:
|
||
entity_id: light.innen_status_led
|
||
- conditions:
|
||
- condition: trigger
|
||
id:
|
||
- sunset
|
||
sequence:
|
||
- action: light.turn_off
|
||
metadata: {}
|
||
data: {}
|
||
target:
|
||
entity_id: light.innen_status_led
|
||
mode: single
|
||
- id: tv_board_manage
|
||
alias: TV Board - Verwaltung
|
||
description: 'Funktioniert nur wenn TV aus ist.
|
||
|
||
Wenn TV Board ist an und (Niemand ist Zuhause oder Zeit ist zwischen 23:00 und
|
||
11:00) dann TV Board ausschalten
|
||
|
||
Wenn TV Board ist aus und (Jemand ist Zuhause oder Zeit ist zwischen 11:00 and
|
||
23:00) dann TV Board einschalten'
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: group.family
|
||
for: 00:04:00
|
||
- trigger: time_pattern
|
||
minutes: /15
|
||
conditions:
|
||
- condition: or
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ is_state(''media_player.sony_kd55x8505b'', ''off'') }}'
|
||
enabled: false
|
||
- condition: state
|
||
entity_id: media_player.sony_kd_55x8505b
|
||
state: 'off'
|
||
enabled: false
|
||
- condition: state
|
||
entity_id: media_player.gq75qn92catxzg
|
||
state: 'off'
|
||
actions:
|
||
- alias: Выбор условий для выключения и включения TV Board
|
||
enabled: false
|
||
choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ is_state(''switch.tuyaplug2'', ''on'') and (is_state(''group.family'',
|
||
''not_home'') or now().hour < 12 or now().hour > 22) }}'
|
||
sequence:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.tuyaplug2
|
||
data: {}
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ is_state(''switch.tuyaplug2'', ''off'') and is_state(''group.family'',
|
||
''home'') and (now().hour > 11 and now().hour < 23) }}'
|
||
sequence:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.tuyaplug2
|
||
data: {}
|
||
- if:
|
||
- condition: template
|
||
value_template: '{{ is_state(''switch.tuyaplug2'', ''on'') and (is_state(''group.family'',
|
||
''not_home'') or now().hour < 12 or now().hour > 22) }}'
|
||
then:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.tuyaplug2
|
||
data: {}
|
||
mode: single
|
||
- id: rolladen_close_if_its_hot
|
||
alias: Rolladen - Automatisch schließen bei Hitze und Sonne
|
||
description: Schließt bestimmte Rolläden, wenn es heiß ist und die Sonne entsprechend
|
||
steht, um die Räume kühl zu halten. Berücksichtigt individuelle Azimut-Schwellenwerte
|
||
pro Rolladen.
|
||
triggers:
|
||
- minutes: /5
|
||
trigger: time_pattern
|
||
conditions:
|
||
- condition: template
|
||
value_template: "{% set sun_azimuth = state_attr('sun.sun', 'azimuth') | float(0)\
|
||
\ %} {% set sun_elevation = state_attr('sun.sun', 'elevation') | float(-91)\
|
||
\ %} {# По умолчанию ниже любого типичного SUN_ELEVATION_MIN_ACTIVE #} {% set\
|
||
\ current_clouds = state_attr('weather.openweathermap', 'cloud_coverage') |\
|
||
\ int(CLOUD_COVERAGE_MAX) %} {# По умолчанию, чтобы условие current_clouds <\
|
||
\ CLOUD_COVERAGE_MAX стало ложным #} {% set ground_temp = states('sensor.rasen_temperature')\
|
||
\ | float(GROUND_TEMP_THRESHOLD - 1) %} {# По умолчанию, чтобы условие ground_temp\
|
||
\ > GROUND_TEMP_THRESHOLD стало ложным #} {% set terrasse_temp = states('sensor.ble_temperature_temperatur_gt')\
|
||
\ | float(TERRASSE_TEMP_THRESHOLD - 1) %} {# По умолчанию, чтобы условие terrasse_temp\
|
||
\ > TERRASSE_TEMP_THRESHOLD стало ложным #}\n{{ SUN_AZIMUTH_MIN_ACTIVE < sun_azimuth\
|
||
\ < SUN_AZIMUTH_MAX_ACTIVE\n and sun_elevation > SUN_ELEVATION_MIN_ACTIVE\n\
|
||
\ and (ground_temp > GROUND_TEMP_THRESHOLD or terrasse_temp > TERRASSE_TEMP_THRESHOLD)\n\
|
||
\ and current_clouds < CLOUD_COVERAGE_MAX\n}}\n"
|
||
actions:
|
||
- repeat:
|
||
for_each: '{{ COVERS_TO_MANAGE }}'
|
||
sequence:
|
||
- variables:
|
||
cover_entity_id: '{{ repeat.item.entity }}'
|
||
current_sun_azimuth: '{{ state_attr(''sun.sun'', ''azimuth'') | float(0)
|
||
}}'
|
||
cover_current_pos: '{{ state_attr(cover_entity_id, ''current_position'')
|
||
| int(-1) }}'
|
||
cover_last_changed_timestamp: '{{ as_timestamp(states[cover_entity_id].last_changed,
|
||
0) }}'
|
||
- condition: template
|
||
value_template: "{# Проверяем, прошел ли азимут солнца триггерный азимут для\
|
||
\ этого роллета. Не двигать, если уже в целевой позиции #} {{ current_sun_azimuth\
|
||
\ >= repeat.item.azimuth_close_trigger and\n cover_current_pos > repeat.item.current_pos_above\
|
||
\ and\n cover_current_pos != repeat.item.target_pos and\n ((as_timestamp(now())\
|
||
\ - cover_last_changed_timestamp) / 60) > COOLDOWN_MINUTES\n}}\n"
|
||
- target:
|
||
entity_id: '{{ cover_entity_id }}'
|
||
data:
|
||
position: '{{ repeat.item.target_pos }}'
|
||
action: cover.set_cover_position
|
||
variables:
|
||
GROUND_TEMP_THRESHOLD: 22
|
||
TERRASSE_TEMP_THRESHOLD: 22
|
||
CLOUD_COVERAGE_MAX: 40
|
||
SUN_AZIMUTH_MIN_ACTIVE: 150
|
||
SUN_AZIMUTH_MAX_ACTIVE: 300
|
||
SUN_ELEVATION_MIN_ACTIVE: 10
|
||
COOLDOWN_MINUTES: 240
|
||
COVERS_TO_MANAGE:
|
||
- entity: cover.shellyswitch25_f37a8c
|
||
azimuth_close_trigger: 150
|
||
current_pos_above: 40
|
||
target_pos: 0
|
||
- entity: cover.shellyswitch25_f37b28
|
||
azimuth_close_trigger: 180
|
||
current_pos_above: 40
|
||
target_pos: 0
|
||
- entity: cover.shellyswitch25_10eaa4
|
||
azimuth_close_trigger: 220
|
||
current_pos_above: 40
|
||
target_pos: 0
|
||
- entity: cover.shellyswitch25_10d315
|
||
azimuth_close_trigger: 240
|
||
current_pos_above: 75
|
||
target_pos: 60
|
||
- id: markise_control
|
||
alias: Markise Verwaltung
|
||
description: Markise automatisch steuern basierend auf Sonne, Temperatur, Wolken
|
||
und Regen.
|
||
triggers:
|
||
- trigger: time_pattern
|
||
minutes: /5
|
||
- trigger: template
|
||
value_template: '{{ is_state(RAIN_SENSOR, ''on'') or (state_attr(''sun.sun'',
|
||
''elevation'') | float(999) < SUN_ELEVATION_THRESHOLD_CLOSE) }}'
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: "{% set sun_azimuth = state_attr('sun.sun', 'azimuth') | float(0)\
|
||
\ %} {% set sun_elevation = state_attr('sun.sun', 'elevation') | float(0)\
|
||
\ %} {% set current_temp = states(TEMP_SENSOR) | float(-100) %} {% set cloud_coverage\
|
||
\ = state_attr(WEATHER_SENSOR, 'cloud_coverage') | float(101) %} {% set\
|
||
\ current_pos = state_attr(COVER_ENTITY_ID, 'current_position') | int(-1)\
|
||
\ %} {% set cover_last_changed_timestamp = as_timestamp(states[COVER_ENTITY_ID].last_changed,\
|
||
\ 0) %}\n{{ sun_azimuth > SUN_AZIMUTH_MIN_OPEN and\n sun_elevation >= SUN_ELEVATION_MIN_OPEN\
|
||
\ and\n current_temp > TEMP_THRESHOLD_OPEN and\n cloud_coverage < CLOUD_COVERAGE_THRESHOLD_OPEN\
|
||
\ and\n is_state(RAIN_SENSOR, 'off') and\n current_pos != POSITION_SUN_PROTECTION\
|
||
\ and\n ((as_timestamp(now()) - cover_last_changed_timestamp) / 60) > COOLDOWN_MINUTES\n\
|
||
}}\n"
|
||
alias: Если солнце мешает, жарко, нет облаков и дождя
|
||
sequence:
|
||
- delay: 3
|
||
- action: cover.set_cover_position
|
||
data:
|
||
position: '{{ POSITION_SUN_PROTECTION }}'
|
||
target:
|
||
entity_id: '{{ COVER_ENTITY_ID }}'
|
||
- conditions:
|
||
- condition: template
|
||
value_template: "{% set sun_elevation = state_attr('sun.sun', 'elevation')\
|
||
\ | float(999) %} {% set current_pos = state_attr(COVER_ENTITY_ID, 'current_position')\
|
||
\ | int(-1) %}\n{{ (is_state(RAIN_SENSOR, 'on') or\n sun_elevation < SUN_ELEVATION_THRESHOLD_CLOSE)\
|
||
\ and\n current_pos != POSITION_RETRACTED\n}}\n"
|
||
alias: Если солнце уже не мешает или дождь
|
||
sequence:
|
||
- delay: 3
|
||
- action: cover.set_cover_position
|
||
data:
|
||
position: '{{ POSITION_RETRACTED }}'
|
||
target:
|
||
entity_id: '{{ COVER_ENTITY_ID }}'
|
||
trigger_variables:
|
||
SUN_ELEVATION_THRESHOLD_CLOSE: 11
|
||
RAIN_SENSOR: binary_sensor.mower_rainsensor_triggered
|
||
variables:
|
||
COVER_ENTITY_ID: cover.markise
|
||
TEMP_SENSOR: sensor.ble_temperature_temperatur_gt
|
||
WEATHER_SENSOR: weather.openweathermap
|
||
TEMP_THRESHOLD_OPEN: 22
|
||
CLOUD_COVERAGE_THRESHOLD_OPEN: 40
|
||
SUN_AZIMUTH_MIN_OPEN: 180
|
||
SUN_ELEVATION_MIN_OPEN: 15
|
||
POSITION_SUN_PROTECTION: 100
|
||
POSITION_RETRACTED: 0
|
||
COOLDOWN_MINUTES: 60
|
||
mode: single
|
||
- id: vacuum_when_nobody_home
|
||
alias: Robi - Niemand zu Hause ist
|
||
description: Wenn Niemand Zuhause ist, dann staubsaugen.
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- group.family
|
||
for:
|
||
hours: 0
|
||
minutes: 10
|
||
seconds: 0
|
||
to: not_home
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ (states("sensor.robi_last_clean_start") | as_datetime).date()
|
||
< now().date() }}'
|
||
actions:
|
||
- action: script.robi_flur
|
||
metadata: {}
|
||
data: {}
|
||
mode: single
|
||
- id: '1726090038559'
|
||
alias: HA - Renew certificate
|
||
description: ''
|
||
triggers:
|
||
- trigger: time
|
||
at: 04:00:00
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{% set expired = (states(''sensor.barma_partia_de_cert_expiry'')
|
||
| as_datetime | as_local) %}
|
||
|
||
{{ (expired.date() - now().date()).days < 7 }}'
|
||
actions:
|
||
- action: hassio.addon_start
|
||
metadata: {}
|
||
data:
|
||
addon: core_letsencrypt
|
||
enabled: false
|
||
- action: hassio.addon_restart
|
||
metadata: {}
|
||
data:
|
||
addon: core_letsencrypt
|
||
mode: single
|
||
- id: weihnachten_licht_an
|
||
alias: Weihnachten - Licht An
|
||
description: Weihnachten licht an am Abend
|
||
triggers:
|
||
- trigger: sun
|
||
event: sunset
|
||
offset: -00:15:00
|
||
conditions:
|
||
- condition: state
|
||
entity_id: group.family_wlan
|
||
alias: Is anybody home
|
||
state: home
|
||
actions:
|
||
- action: switch.turn_on
|
||
data:
|
||
entity_id: switch.weihnachten
|
||
mode: single
|
||
- id: weihnachten_licht_an_anatolij
|
||
alias: Weihnachten - Licht An Anatolij
|
||
description: Weihnachten licht an am Morgens für Anatolij
|
||
mode: single
|
||
triggers:
|
||
- trigger: time
|
||
at: 08:20:00
|
||
conditions:
|
||
- condition: and
|
||
conditions:
|
||
- condition: sun
|
||
before: sunrise
|
||
after_offset: 00:15:00
|
||
- condition: time
|
||
weekday:
|
||
- mon
|
||
- tue
|
||
- wed
|
||
- thu
|
||
- fri
|
||
actions:
|
||
- action: switch.turn_on
|
||
data:
|
||
entity_id: switch.weihnachten
|
||
- id: weihnachten_licht_an_wenn_jemand_kommt
|
||
alias: Weihnachten - Licht An wenn jemand kommt
|
||
description: Weihnachten licht an wenn jemand kommt
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- group.family_wlan
|
||
- group.family
|
||
from: not_home
|
||
to: home
|
||
for:
|
||
hours: 0
|
||
minutes: 3
|
||
seconds: 0
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ state_attr(''sun.sun'', ''elevation'') < 4 }}'
|
||
actions:
|
||
- action: switch.turn_on
|
||
data:
|
||
entity_id: switch.weihnachten
|
||
mode: single
|
||
- id: weihnachten_licht_aus
|
||
alias: Weihnachten - Licht Aus
|
||
description: Weihnachten licht aus
|
||
triggers:
|
||
- trigger: time
|
||
at:
|
||
- 00:00:00
|
||
- 09:30:00
|
||
- trigger: sun
|
||
event: sunrise
|
||
offset: 00:15:00
|
||
- trigger: state
|
||
entity_id:
|
||
- group.family_wlan
|
||
- group.family
|
||
from: home
|
||
to: not_home
|
||
for:
|
||
hours: 0
|
||
minutes: 5
|
||
seconds: 0
|
||
conditions: []
|
||
actions:
|
||
- action: switch.turn_off
|
||
data:
|
||
entity_id: switch.weihnachten
|
||
mode: single
|
||
- id: robi_yandex_home
|
||
alias: Robi - Yandex Haus
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Уберись дома
|
||
actions:
|
||
- action: script.robi_home
|
||
mode: single
|
||
- id: robi_yandex_kitchen
|
||
alias: Robi - Yandex Küche
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери кухню
|
||
actions:
|
||
- action: script.robi_kitchen
|
||
mode: single
|
||
- id: robi_yandex_living_room
|
||
alias: Robi - Yandex Wohnzimmer
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери зал
|
||
actions:
|
||
- action: script.robi_living_room
|
||
mode: single
|
||
- id: robi_yandex_stube
|
||
alias: Robi - Yandex Stube
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери гостиную
|
||
actions:
|
||
- action: script.robi_stube
|
||
data: {}
|
||
mode: single
|
||
- id: robi_yandex_bedroom
|
||
alias: Robi - Yandex Schlafzimmer
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери спальню
|
||
actions:
|
||
- action: script.robi_bedroom
|
||
mode: single
|
||
- id: robi_yandex_flur
|
||
alias: Robi - Yandex Flur
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери коридор
|
||
actions:
|
||
- action: script.robi_flur
|
||
mode: single
|
||
- id: robi_yandex_hwr
|
||
alias: Robi - Yandex HWR
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери кладовку
|
||
actions:
|
||
- action: script.robi_hwr
|
||
data: {}
|
||
mode: single
|
||
- id: robi_yandex_wc
|
||
alias: Robi - Yandex WC
|
||
description: ''
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Убери туалет
|
||
actions:
|
||
- action: script.robi_wc
|
||
mode: single
|
||
- id: seitenmarkise_control
|
||
alias: Seitenmarkise Verwaltung
|
||
description: Seitenmarkise automatisch steuern basierend auf Sonne, Temperatur,
|
||
Wolken und Regen.
|
||
triggers:
|
||
- trigger: time_pattern
|
||
minutes: /5
|
||
- trigger: template
|
||
value_template: '{{ is_state(RAIN_SENSOR, ''on'') or (state_attr(''sun.sun'',
|
||
''elevation'') | float(999) < SUN_ELEVATION_THRESHOLD_RETRACT) }}'
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: "{% set sun_azimuth = state_attr('sun.sun', 'azimuth') | float(0)\
|
||
\ %} {% set sun_elevation = state_attr('sun.sun', 'elevation') | float(0)\
|
||
\ %} {% set current_temp = states(TEMP_SENSOR) | float(-100) %} {% set cloud_coverage\
|
||
\ = state_attr(WEATHER_SENSOR, 'cloud_coverage') | float(101) %} {% set\
|
||
\ current_pos = state_attr(COVER_ENTITY_ID, 'current_position') | int(-1)\
|
||
\ %} {% set cover_last_changed_timestamp = as_timestamp(states[COVER_ENTITY_ID].last_changed,\
|
||
\ 0) %}\n{{ sun_azimuth > SUN_AZIMUTH_MIN_DEPLOY and\n sun_elevation >=\
|
||
\ SUN_ELEVATION_MIN_DEPLOY and\n current_temp > TEMP_THRESHOLD_DEPLOY and\n\
|
||
\ cloud_coverage < CLOUD_COVERAGE_THRESHOLD_DEPLOY and\n is_state(RAIN_SENSOR,\
|
||
\ 'off') and\n current_pos > POSITION_SUN_PROTECTION and\n ((as_timestamp(now())\
|
||
\ - cover_last_changed_timestamp) / 60) > COOLDOWN_MINUTES\n}}\n"
|
||
alias: Если солнце мешает, жарко, нет облаков и дождя
|
||
sequence:
|
||
- action: cover.set_cover_position
|
||
data:
|
||
position: '{{ POSITION_SUN_PROTECTION }}'
|
||
target:
|
||
entity_id: '{{ COVER_ENTITY_ID }}'
|
||
- conditions:
|
||
- condition: template
|
||
value_template: "{% set sun_elevation = state_attr('sun.sun', 'elevation')\
|
||
\ | float(999) %} {% set current_pos = state_attr(COVER_ENTITY_ID, 'current_position')\
|
||
\ | int(-1) %}\n{{ (is_state(RAIN_SENSOR, 'on') or\n sun_elevation < SUN_ELEVATION_THRESHOLD_RETRACT)\
|
||
\ and\n current_pos != POSITION_RETRACTED\n}}\n"
|
||
alias: Если солнце уже не мешает или дождь
|
||
sequence:
|
||
- action: cover.set_cover_position
|
||
data:
|
||
position: '{{ POSITION_RETRACTED }}'
|
||
target:
|
||
entity_id: '{{ COVER_ENTITY_ID }}'
|
||
trigger_variables:
|
||
SUN_ELEVATION_THRESHOLD_RETRACT: 11
|
||
RAIN_SENSOR: binary_sensor.mower_rainsensor_triggered
|
||
variables:
|
||
COVER_ENTITY_ID: cover.seitenmarkise
|
||
TEMP_SENSOR: sensor.ble_temperature_temperatur_gt
|
||
WEATHER_SENSOR: weather.openweathermap
|
||
TEMP_THRESHOLD_DEPLOY: 22
|
||
CLOUD_COVERAGE_THRESHOLD_DEPLOY: 40
|
||
SUN_AZIMUTH_MIN_DEPLOY: 180
|
||
SUN_ELEVATION_MIN_DEPLOY: 12
|
||
POSITION_SUN_PROTECTION: 15
|
||
POSITION_RETRACTED: 100
|
||
COOLDOWN_MINUTES: 120
|
||
mode: single
|
||
- id: '1746608947446'
|
||
alias: debug
|
||
description: ''
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.sonoffs20_2
|
||
to: 'on'
|
||
id: cycle1
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.sonoffs20_2
|
||
to: 'off'
|
||
id: cycle2
|
||
conditions: []
|
||
actions:
|
||
- action: notify.telegram_bot_anatolij
|
||
metadata: {}
|
||
data:
|
||
message: '{{ trigger.id[-1] }}'
|
||
mode: single
|
||
- id: garage_smartthing_sync
|
||
alias: Garage - Smarttagsverwaltung
|
||
description: ''
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.st_virtual_switch1
|
||
- switch.st_virtual_switch2
|
||
conditions: []
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.entity_id == ''switch.st_virtual_switch1'' }}'
|
||
sequence:
|
||
- action: switch.toggle
|
||
metadata: {}
|
||
data: {}
|
||
target:
|
||
entity_id: switch.tor
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.entity_id == ''switch.st_virtual_switch2'' }}'
|
||
sequence:
|
||
- action: switch.toggle
|
||
metadata: {}
|
||
data: {}
|
||
target:
|
||
entity_id: switch.torteil
|
||
mode: single
|
||
- id: set_rolladen_last_action
|
||
alias: Rolladen - Set last action
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- cover.rolladen
|
||
- cover.shellyswitch25_10d315
|
||
- cover.shellyswitch25_10eaa4
|
||
- cover.shellyswitch25_f37a8c
|
||
- cover.shellyswitch25_f37b28
|
||
- cover.markise
|
||
- cover.seitenmarkise
|
||
conditions:
|
||
- condition: or
|
||
conditions:
|
||
- '{{ trigger.from_state.state == ''opening'' }}'
|
||
- '{{ trigger.from_state.state == ''closing'' }}'
|
||
actions:
|
||
- action: input_text.set_value
|
||
target:
|
||
entity_id: input_text.{{ trigger.to_state.object_id }}_last_action
|
||
data:
|
||
value: '{{ trigger.from_state.state }}'
|
||
- id: torteiloffnung_on
|
||
alias: Garage - Torteiloffnung ON
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: switch.torteil
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.torteil
|
||
state: 'off'
|
||
actions:
|
||
- delay:
|
||
seconds: 2
|
||
- alias: ''
|
||
action: input_boolean.turn_on
|
||
data:
|
||
entity_id: input_boolean.torteil
|
||
- id: telegram_tor
|
||
alias: Telegram - Tor
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /tor
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /torteil
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /tor
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /torteil
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/tor'' }}'
|
||
sequence:
|
||
- action: switch.toggle
|
||
data:
|
||
entity_id: switch.tor
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.tor
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: '{{ state_attr(''switch.tor'', ''friendly_name'') }} - {{ state_attr(''cover.tor'',
|
||
''current_position'') }}%'
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/torteil'' }}'
|
||
sequence:
|
||
- action: switch.toggle
|
||
data:
|
||
entity_id: switch.torteil
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.tor
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: '{{ state_attr(''switch.torteil'', ''friendly_name'') }} - {{ state_attr(''cover.tor'',
|
||
''current_position'') }}%'
|
||
- id: garage_auto_close
|
||
alias: Garage - Autoschließen
|
||
description: Гараж - Автоматическое закрытие (открыт >13% более 30 мин, темно, свет
|
||
выкл)
|
||
mode: single
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.garage_open_too_long
|
||
to: 'on'
|
||
- trigger: state
|
||
entity_id: sun.sun
|
||
to: below_horizon
|
||
- trigger: state
|
||
entity_id: binary_sensor.all_lights_off
|
||
to: 'on'
|
||
- trigger: homeassistant
|
||
event: start
|
||
condition:
|
||
- condition: state
|
||
entity_id: sun.sun
|
||
state: below_horizon
|
||
- condition: state
|
||
entity_id: binary_sensor.all_lights_off
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: binary_sensor.garage_open_too_long
|
||
state: 'on'
|
||
actions:
|
||
- variables:
|
||
initial_pos: '{{ state_attr(''cover.tor'', ''current_position'') | int }}'
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: Гараж открыт уже 30 минут, сейчас темно и свет везде выключен. Планирую
|
||
закрыть через 1 минуту. Свет будет мигать. Если ворота сдвинутся более чем
|
||
на 10%, закрытие отменится.
|
||
- alias: Минутное ожидание с миганием и проверкой отмены
|
||
repeat:
|
||
count: 12
|
||
sequence:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{% set current_pos = state_attr(''cover.tor'', ''current_position'')
|
||
| int(0) %} {{ (current_pos - initial_pos) | abs > 10 }}
|
||
|
||
'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: Автоматическое закрытие гаража отменено, так как положение
|
||
ворот изменилось более чем на 10%.
|
||
- stop: Закрытие отменено из-за изменения положения ворот
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoffbnsz01
|
||
data: {}
|
||
- delay:
|
||
seconds: 2.5
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoffbnsz01
|
||
data: {}
|
||
- delay:
|
||
seconds: 2.5
|
||
- condition: template
|
||
value_template: '{% set current_pos = state_attr(''cover.tor'', ''current_position'')
|
||
| int(0) %} {{ (current_pos - initial_pos) | abs <= 10 }}
|
||
|
||
'
|
||
- condition: template
|
||
value_template: '{{ states(''cover.tor'') == ''open'' and state_attr(''cover.tor'',
|
||
''current_position'') | int(0) > 13 }}'
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: Начинаю процедуру автоматического закрытия гаража...
|
||
- alias: Закрытие гаража - Попытка 1
|
||
action: switch.toggle
|
||
target:
|
||
entity_id: switch.tor
|
||
- delay:
|
||
seconds: 3
|
||
- choose:
|
||
- conditions:
|
||
- '{{ states(''cover.tor'') == ''closing'' or states(''cover.tor'') == ''closed''
|
||
}}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: Ворота закрываются/закрыты после 1-й команды.
|
||
- conditions:
|
||
- '{{ states(''cover.tor'') == ''opening'' or states(''cover.tor'') == ''open''
|
||
}}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: После 1-й команды, ворота {{ states('cover.tor') }}. Отправляю
|
||
2-ю команду...
|
||
- alias: Закрытие гаража - Попытка 2
|
||
action: switch.toggle
|
||
target:
|
||
entity_id: switch.tor
|
||
- delay:
|
||
seconds: 3
|
||
- choose:
|
||
- conditions:
|
||
- '{{ states(''cover.tor'') == ''closing'' or states(''cover.tor'') == ''closed''
|
||
}}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: Ворота закрываются/закрыты после 2-й команды.
|
||
- conditions:
|
||
- '{{ states(''cover.tor'') == ''opening'' or states(''cover.tor'') == ''open''
|
||
}}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: После 2-й команды, ворота {{ states('cover.tor') }}. Отправляю
|
||
3-ю команду...
|
||
- alias: Закрытие гаража - Попытка 3
|
||
action: switch.toggle
|
||
target:
|
||
entity_id: switch.tor
|
||
- delay:
|
||
seconds: 3
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: '3-я команда отправлена. Текущее состояние: {{ states(''cover.tor'')
|
||
}}. Ожидаю полного закрытия.'
|
||
default:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж - Ошибка
|
||
message: Неожиданное состояние ворот {{ states('cover.tor') }} после 2-й
|
||
попытки закрытия.
|
||
default:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж - Ошибка
|
||
message: Неожиданное состояние ворот {{ states('cover.tor') }} после 1-й попытки
|
||
закрытия.
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.tor
|
||
to: closed
|
||
timeout:
|
||
minutes: 2
|
||
continue_on_timeout: true
|
||
- variables:
|
||
garage_closed_successfully: '{{ wait.trigger is not none and states(''cover.tor'')
|
||
== ''closed'' }}'
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🚗Гараж
|
||
message: "{% if garage_closed_successfully %}\n Гараж успешно закрыт автоматически.\n\
|
||
{% else %}\n Гараж не закрылся (состояние: {{ states('cover.tor') }}, позиция:\
|
||
\ {{ state_attr('cover.tor', 'current_position') }}%) в течение 2 минут после\
|
||
\ команды автоматического закрытия.\n{% endif %}\n"
|
||
- id: irrigation_set_next_run_time_when_schedule_enabled_or_time_changed
|
||
alias: Irrigation - Zeitplan bei der Zeitänderung oder Automat Aktivierung
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_enable
|
||
- input_boolean.irrigation_cycle2_enable
|
||
to: 'on'
|
||
- trigger: state
|
||
entity_id:
|
||
- input_select.irrigation_cycle1_schedule_time
|
||
- input_select.irrigation_cycle2_schedule_time
|
||
- trigger: state
|
||
entity_id:
|
||
- input_select.irrigation_cycle1_watering_days
|
||
- input_select.irrigation_cycle2_watering_days
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.irrigation_master_control_switch
|
||
state: 'on'
|
||
- condition: or
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.irrigation_cycle1_enable
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.irrigation_cycle2_enable
|
||
state: 'on'
|
||
actions:
|
||
- variables:
|
||
cycle_num: '{{ ''1'' if ''cycle1'' in trigger.entity_id else ''2'' }}'
|
||
- action: input_datetime.set_datetime
|
||
data:
|
||
entity_id: input_datetime.irrigation_cycle{{ cycle_num }}_next_run_time
|
||
date: "{% set schedule_time_str = states('input_select.irrigation_cycle' ~ cycle_num\
|
||
\ ~ '_schedule_time') %} {% if now().strftime('%H:%M') < schedule_time_str\
|
||
\ %}\n {{ now().strftime('%Y-%m-%d') }}\n{% else %}\n {{ (now() + timedelta(days=1)).strftime('%Y-%m-%d')\
|
||
\ }}\n{% endif %}\n"
|
||
time: '{{ states(''input_select.irrigation_cycle'' ~ cycle_num ~ ''_schedule_time'')
|
||
}}
|
||
|
||
'
|
||
- id: irrigation_run_cycle_1
|
||
alias: Irrigation - Start Morgenzyklus
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.irrigation_cycle1_next_run_time
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.irrigation_cycle1_enable
|
||
state: 'on'
|
||
actions:
|
||
- action: script.irrigation_check_a_sensor_data
|
||
data:
|
||
cycle: '1'
|
||
- action: script.irrigation_update_next_runtime
|
||
data:
|
||
cycle: '1'
|
||
- id: irrigation_run_cycle_2
|
||
alias: Irrigation - Start Abendzyklus
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.irrigation_cycle2_next_run_time
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.irrigation_cycle2_enable
|
||
state: 'on'
|
||
actions:
|
||
- action: script.irrigation_check_a_sensor_data
|
||
data:
|
||
cycle: '2'
|
||
- action: script.irrigation_update_next_runtime
|
||
data:
|
||
cycle: '2'
|
||
- id: irrigation_run_a_cycle_manually
|
||
alias: Irrigation - Manuell starten
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_manual_run
|
||
- input_boolean.irrigation_cycle2_manual_run
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
- condition: template
|
||
value_template: "{% if trigger.entity_id == 'input_boolean.irrigation_cycle1_manual_run'\
|
||
\ %}\n {{ states('input_boolean.irrigation_cycle2_running') == 'off' }}\n{%\
|
||
\ else %}\n {{ states('input_boolean.irrigation_cycle1_running') == 'off' }}\n\
|
||
{% endif %}\n"
|
||
actions:
|
||
- action: input_text.set_value
|
||
data:
|
||
entity_id: input_text.irrigation_current_zone
|
||
value: Initialisierung...
|
||
- action: switch.turn_off
|
||
data:
|
||
entity_id: switch.irrigation_valves
|
||
- action: script.turn_off
|
||
target:
|
||
entity_id:
|
||
- script.irrigation_run_a_cycle
|
||
- script.irrigation_irrigate_a_zone
|
||
- action: input_boolean.turn_{{ 'on' if is_state('input_boolean.irrigation_cycle1_enable',
|
||
'on') else 'off' }}
|
||
target:
|
||
entity_id: input_boolean.irrigation_cycle1_enable_saved_state
|
||
- action: input_boolean.turn_{{ 'on' if is_state('input_boolean.irrigation_cycle2_enable',
|
||
'on') else 'off' }}
|
||
target:
|
||
entity_id: input_boolean.irrigation_cycle2_enable_saved_state
|
||
- action: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_enable
|
||
- input_boolean.irrigation_cycle2_enable
|
||
- action: script.irrigation_run_a_cycle
|
||
data:
|
||
cycle: "{% if trigger.entity_id == 'input_boolean.irrigation_cycle1_manual_run'\
|
||
\ %}\n 1\n{% else %}\n 2\n{% endif %}\n"
|
||
- wait_template: '{{ is_state(''script.irrigation_run_a_cycle'', ''off'') }}'
|
||
- action: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_manual_run
|
||
- input_boolean.irrigation_cycle2_manual_run
|
||
- action: input_boolean.turn_{{ 'on' if is_state('input_boolean.irrigation_cycle1_enable_saved_state',
|
||
'on') else 'off' }}
|
||
target:
|
||
entity_id: input_boolean.irrigation_cycle1_enable
|
||
- action: input_boolean.turn_{{ 'on' if is_state('input_boolean.irrigation_cycle2_enable_saved_state',
|
||
'on') else 'off' }}
|
||
target:
|
||
entity_id: input_boolean.irrigation_cycle2_enable
|
||
- id: irrigation_cancel_a_manual_cycle
|
||
alias: Irrigation - Abbrechen manueller Zyklus
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_manual_run
|
||
- input_boolean.irrigation_cycle2_manual_run
|
||
from: 'on'
|
||
to: 'off'
|
||
actions:
|
||
- action: switch.turn_off
|
||
data:
|
||
entity_id: switch.irrigation_valves
|
||
- action: script.turn_off
|
||
target:
|
||
entity_id:
|
||
- script.irrigation_run_a_cycle
|
||
- script.irrigation_irrigate_a_zone
|
||
- action: timer.cancel
|
||
data:
|
||
entity_id: timer.irrigation_zone_duration
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: input_boolean.irrigation_cycle{{ '1' if trigger.entity_id == 'input_boolean.irrigation_cycle1_manual_run'
|
||
else '2' }}_running
|
||
- action: input_text.set_value
|
||
data:
|
||
entity_id: input_text.irrigation_current_zone
|
||
value: '-'
|
||
- id: irrigation_cancel_if_it_rains
|
||
alias: Irrigation - Abbrechen wenn es regnet
|
||
mode: single
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.mower_rainsensor_triggered
|
||
to: 'on'
|
||
- trigger: template
|
||
value_template: '{{ is_state(''binary_sensor.mower_rainsensor_triggered'',''on'')
|
||
}}'
|
||
for: 00:01:00
|
||
actions:
|
||
- action: timer.cancel
|
||
entity_id: timer.irrigation_zone_duration
|
||
- id: irrigation_master_control_switch
|
||
alias: Irrigation - Master Control Switch
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_boolean.irrigation_master_control_switch
|
||
- trigger: homeassistant
|
||
event: start
|
||
actions:
|
||
- action: input_boolean.turn_off
|
||
data:
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_manual_run
|
||
- input_boolean.irrigation_cycle2_manual_run
|
||
- action: "{% if is_state('input_boolean.irrigation_master_control_switch', 'on')\
|
||
\ %}\n automation.turn_on\n{% else %}\n automation.turn_off\n{% endif %}\n"
|
||
data:
|
||
entity_id: "{% for item in states['automation'] if item.name.startswith('Irrigation\
|
||
\ - ')\n and item.name.find('Master Control Switch') == -1\n and item.name.find('Regular\
|
||
\ pumping') == -1 -%}\n {% if not loop.first %},{% endif %}{{ item.entity_id\
|
||
\ }}\n{%- endfor %}\n"
|
||
- action: mqtt.publish
|
||
data:
|
||
topic: sonoff4ch/cmnd/pulsetime1
|
||
payload: 0
|
||
- action: mqtt.publish
|
||
data:
|
||
topic: sonoff4ch/cmnd/pulsetime2
|
||
payload: 0
|
||
- action: mqtt.publish
|
||
data:
|
||
topic: sonoff4ch/cmnd/pulsetime3
|
||
payload: 0
|
||
- action: mqtt.publish
|
||
data:
|
||
topic: sonoff4ch/cmnd/pulsetime4
|
||
payload: 0
|
||
- id: irrigation_failsafe_pump_control_switch
|
||
alias: Irrigation - Failsafe Pump Control Switch
|
||
description: Отключение насоса, при отключении автоматизации полива
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_boolean.irrigation_master_control_switch
|
||
to: 'off'
|
||
actions:
|
||
- action: switch.turn_off
|
||
entity_id: switch.irrigation_pump
|
||
- id: irrigation_pump_on
|
||
alias: Irrigation - Pump ON
|
||
description: Включение насоса, если открылся один из клапанов
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: switch.irrigation_valves
|
||
to: 'on'
|
||
for: 00:00:01
|
||
conditions:
|
||
- condition: state
|
||
entity_id: switch.irrigation_pump
|
||
state: 'off'
|
||
actions:
|
||
- action: switch.turn_on
|
||
entity_id: switch.irrigation_pump
|
||
- id: irrigation_pump_off
|
||
alias: Irrigation - Pump OFF
|
||
description: Выключение насоса, если закрыты все клапаны с задержкой для смены зоны
|
||
полива
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: switch.irrigation_valves
|
||
to: 'off'
|
||
for: 00:00:04
|
||
- trigger: time_pattern
|
||
minutes: /15
|
||
conditions:
|
||
- condition: and
|
||
conditions:
|
||
- condition: state
|
||
entity_id: switch.irrigation_valves
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: switch.irrigation_zone3_valve
|
||
state: 'off'
|
||
actions:
|
||
- action: switch.turn_off
|
||
entity_id: switch.irrigation_pump
|
||
- id: irrigation_regular_pumping
|
||
alias: Irrigation - Regular pumping
|
||
description: Регулярная подкачка воды
|
||
triggers:
|
||
- trigger: time_pattern
|
||
hours: /4
|
||
minutes: '2'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: switch.irrigation_pump
|
||
state: 'off'
|
||
actions:
|
||
- action: switch.turn_on
|
||
entity_id: switch.irrigation_pump
|
||
- delay: 15
|
||
- action: switch.turn_off
|
||
entity_id: switch.irrigation_pump
|
||
- id: irrigation_notify
|
||
alias: Irrigation - Notify
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.irrigation_switches_zone1
|
||
- switch.irrigation_switches_zone2
|
||
- switch.irrigation_switches_zone3
|
||
from: 'on'
|
||
to: 'off'
|
||
variables:
|
||
action: Ende
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.irrigation_switches_zone1
|
||
- switch.irrigation_switches_zone2
|
||
- switch.irrigation_switches_zone3
|
||
from: 'off'
|
||
to: 'on'
|
||
variables:
|
||
action: Start
|
||
actions:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 💦 Bewässerung
|
||
message: '{{ action }} *{{ trigger.from_state.attributes.friendly_name}}*'
|
||
- id: irrigation_failsafe_master_control_switch
|
||
alias: Irrigation - Failsafe Master Control Switch
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_boolean.irrigation_master_control_switch
|
||
to: 'off'
|
||
- trigger: homeassistant
|
||
event: start
|
||
actions:
|
||
- action: homeassistant.turn_off
|
||
entity_id:
|
||
- input_boolean.irrigation_cycle1_manual_run
|
||
- input_boolean.irrigation_cycle2_manual_run
|
||
- switch.irrigation_zone1_valve
|
||
- switch.irrigation_zone2_valve
|
||
- switch.irrigation_zone3_valve
|
||
- id: irrigation_failsafe_valve_1_on
|
||
alias: Irrigation - Failsafe Valve 1 On
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.irrigation_zone1_valve
|
||
to: 'on'
|
||
actions:
|
||
- action: switch.turn_off
|
||
entity_id:
|
||
- switch.irrigation_zone2_valve
|
||
- wait_template: '{{ is_state(''switch.irrigation_zone1_valve'', ''off'') }}'
|
||
timeout: 02:00:15
|
||
- action: switch.turn_off
|
||
entity_id:
|
||
- switch.irrigation_zone1_valve
|
||
- id: irrigation_failsafe_valve_2_on
|
||
alias: Irrigation - Failsafe Valve 2 On
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.irrigation_zone2_valve
|
||
to: 'on'
|
||
actions:
|
||
- action: switch.turn_off
|
||
entity_id:
|
||
- switch.irrigation_zone1_valve
|
||
- wait_template: '{{ is_state(''switch.irrigation_zone2_valve'', ''off'') }}'
|
||
timeout: 02:00:15
|
||
- action: switch.turn_off
|
||
entity_id:
|
||
- switch.irrigation_zone2_valve
|
||
- id: mower_notify_status
|
||
alias: Mower status notification
|
||
initial_state: false
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: lawn_mower.mower
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
|
||
actions:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🏎️ Lanroid M500
|
||
message: '*{{ trigger.to_state.state }}* <- {{ trigger.from_state.state }}'
|
||
- id: mower_notify_error
|
||
alias: Mower error notification
|
||
initial_state: true
|
||
triggers:
|
||
- trigger: template
|
||
value_template: '{{ states(''sensor.mower_error'') }}'
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
|
||
actions:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🏎️ Lanroid M500
|
||
message: '*{{ trigger.to_state.state }}: {{ states(''sensor.mower_error'') }}*
|
||
<- {{ trigger.from_state.state }}: {{ states(''sensor.mower_error'') }}'
|
||
- id: nataljas_night_shift
|
||
alias: Nataljas night shift
|
||
description: Set Natalja's night shift
|
||
triggers:
|
||
- trigger: time
|
||
at:
|
||
- 07:00
|
||
- '19:00'
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ is_state(''calendar.dienstplan_natalja_schick'',''on'') }}'
|
||
actions:
|
||
- action: "{% set night_shift_start = as_timestamp(states.calendar.dienstplan_natalja_schick.attributes.start_time)\
|
||
\ %} {% if (( night_shift_start - as_timestamp(now()) ) < 86400 )\n and ((\
|
||
\ night_shift_start - as_timestamp(now()) ) > 0 ) %}\n input_boolean.turn_on\n\
|
||
{% else %}\n input_boolean.turn_off\n{% endif %}"
|
||
target:
|
||
entity_id: input_boolean.nataljas_night_shift
|
||
- id: radio_stop
|
||
alias: Radio - Stop
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_select.radio_station
|
||
to: Stop
|
||
actions:
|
||
action: script.radio_stop
|
||
- id: radio_stream
|
||
alias: Radio - Stream
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_select.radio_station
|
||
- trigger: state
|
||
entity_id: input_select.radio_player
|
||
actions:
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id: "{% set entities = {\n 'Garten':'media_player.googlehome9539',\n\
|
||
\ 'Nest Mini':'media_player.nest_mini',\n 'Sound Blaster':'media_player.soundblaster',\n\
|
||
\ 'Home Mini Flur':'media_player.flur',\n 'Home Mini Kristina':'media_player.kristina',\n\
|
||
\ 'Überall':'media_player.home_group',\n 'Erdgeschoss':'media_player.erdgeschoss',\n\
|
||
\ }\n%} {{ iif(trigger.from_state in entities, entities[trigger.from_state],\
|
||
\ 'media_player.nest_mini') }}"
|
||
- action: script.radio
|
||
- id: radio_volume
|
||
alias: Radio - Volume
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_number.radio_volume
|
||
actions:
|
||
action: media_player.volume_set
|
||
data:
|
||
entity_id: "{% set entities = {\n 'Garten':'media_player.googlehome9539',\n\
|
||
\ 'Nest Mini':'media_player.nest_mini',\n 'Sound Blaster':'media_player.soundblaster',\n\
|
||
\ 'Home Mini Flur':'media_player.flur',\n 'Home Mini Kristina':'media_player.kristina',\n\
|
||
\ 'Überall':'media_player.home_group',\n 'Erdgeschoss':'media_player.erdgeschoss',\n\
|
||
\ }\n%} {% set state = states('input_select.radio_player') %} {{ iif(state\
|
||
\ in entities, entities[state], 'media_player.nest_mini') }}\n"
|
||
volume_level: '{{ states(''input_number.radio_volume'') }}'
|
||
- id: telegram_kueche
|
||
alias: Telegram - Kueche
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /kuechenlicht
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /kuechenlicht
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /essecke
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /essecke
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/kuechenlicht'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.shellyswitch25_10a36d_channel_1
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.shellyswitch25_10a36d_channel_1
|
||
continue_on_timeout: true
|
||
timeout: 00:00:01
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.shellyswitch25_10a36d_channel_1', 'friendly_name')
|
||
}} - {{ states('light.shellyswitch25_10a36d_channel_1') }}
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/essecke'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.shellyswitch25_10a36d_channel_2
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.shellyswitch25_10a36d_channel_2
|
||
continue_on_timeout: true
|
||
timeout: 00:00:01
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.shellyswitch25_10a36d_channel_2', 'friendly_name')
|
||
}} - {{ states('light.shellyswitch25_10a36d_channel_2') }}
|
||
- id: telegram_rollade_1
|
||
alias: Telegram - Rollade 1
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /rollade_1
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /rollade_1
|
||
actions:
|
||
- action: script.cover_one_button
|
||
data:
|
||
entity_id: shellyswitch25_f37a8c
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.shellyswitch25_f37a8c
|
||
timeout: 00:00:02
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 🏡 {{ state_attr('cover.shellyswitch25_f37a8c', 'friendly_name') }}
|
||
- {{ states('cover.shellyswitch25_f37a8c') }}
|
||
- id: telegram_rollade_2
|
||
alias: Telegram - Rollade 2
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /rollade_2
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /rollade_2
|
||
actions:
|
||
- action: script.cover_one_button
|
||
data:
|
||
entity_id: shellyswitch25_f37b28
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.shellyswitch25_f37b28
|
||
timeout: 00:00:02
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 🏡 {{ state_attr('cover.shellyswitch25_f37b28', 'friendly_name') }}
|
||
- {{ states('cover.shellyswitch25_f37b28') }}
|
||
- id: telegram_rollade_3
|
||
alias: Telegram - Rollade 3
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /rollade_3
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /rollade_3
|
||
actions:
|
||
- action: script.cover_one_button
|
||
data:
|
||
entity_id: shellyswitch25_10eaa4
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.shellyswitch25_10eaa4
|
||
timeout: 00:00:02
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 🏡 {{ state_attr('cover.shellyswitch25_10eaa4', 'friendly_name') }}
|
||
- {{ states('cover.shellyswitch25_10eaa4') }}
|
||
- id: telegram_rollade_4
|
||
alias: Telegram - Rollade Terrasse
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /rollade_4
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /rollade_4
|
||
actions:
|
||
- action: script.cover_one_button
|
||
data:
|
||
entity_id: shellyswitch25_10d315
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: cover.shellyswitch25_10d315
|
||
timeout: 00:00:02
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 🏡 {{ state_attr('cover.shellyswitch25_10d315', 'friendly_name') }}
|
||
- {{ states('cover.shellyswitch25_10d315') }}
|
||
- id: telegram_wohnlicht
|
||
alias: Telegram - Wohnlicht
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /wohnlicht
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /wohnlicht
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.shelly1pmminig3_34b7da8db254_switch_0
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.shelly1pmminig3_34b7da8db254_switch_0
|
||
timeout: 1
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.shelly1pmminig3_34b7da8db254_switch_0', 'friendly_name')
|
||
}} ist {{ states('light.shelly1pmminig3_34b7da8db254_switch_0') }}
|
||
- id: telegram_sonoffpow_01
|
||
alias: Telegram - Sonoffpow_01
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /wandlicht
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /wandlicht
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.sonoffpow_01
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.sonoffpow_01
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.sonoffpow_01', 'friendly_name') }} - {{ states('light.sonoffpow_01')
|
||
}}
|
||
- utility_meter:
|
||
sonoffpow_02_energy_m:
|
||
unique_id: sonoffpow_02_energy_m
|
||
source: sensor.sonoffpow_02_energy_total
|
||
cycle: monthly
|
||
sonoffpow_02_energy_y:
|
||
unique_id: sonoffpow_02_energy_y
|
||
source: sensor.sonoffpow_02_energy_total
|
||
cycle: yearly
|
||
homeassistant:
|
||
customize:
|
||
switch.sonoffpow_02:
|
||
friendly_name: Irrigation
|
||
icon: mdi:power
|
||
sensor.sonoffpow_02_energy_totalstarttime:
|
||
friendly_name: Seit (Irrigation)
|
||
sensor.sonoffpow_02_energy_power:
|
||
friendly_name: Leistung (Irrigation)
|
||
icon: mdi:lightning-bolt
|
||
device_class: power
|
||
sensor.sonoffpow_02_energy_total:
|
||
friendly_name: Verbrauch (Irrigation)
|
||
icon: mdi:counter
|
||
sensor.sonoffpow_02_energy_today:
|
||
friendly_name: Verbrauch Täglich (Irrigation)
|
||
icon: mdi:counter
|
||
sensor.sonoffpow_02_energy_m:
|
||
friendly_name: Verbrauch Monatlich (Irrigation)
|
||
sensor.sonoffpow_02_energy_y:
|
||
friendly_name: Verbrauch Jahrlich (Irrigation)
|
||
- id: telegram_sonoffpow_03
|
||
alias: Telegram - Sonoffpow_03
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /terrassenlicht
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /terrassenlicht
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.sonoffpow_03
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.sonoffpow_03
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.sonoffpow_03', 'friendly_name') }} - {{ states('light.sonoffpow_03')
|
||
}}
|
||
- id: telegram_sonoffpow_04
|
||
alias: Telegram - Sonoffpow_04
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /ambiente_kueche
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /ambiente_kueche
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.sonoffpow_04
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.sonoffpow_04
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.sonoffpow_04', 'friendly_name') }} - {{ states('light.sonoffpow_04')
|
||
}}
|
||
- id: camera_upload_to_telegram
|
||
alias: Camera - Upload to Telegram
|
||
description: Отправка файлов в Telegram
|
||
mode: parallel
|
||
max: 10
|
||
triggers:
|
||
- trigger: event
|
||
event_type: folder_watcher
|
||
event_data:
|
||
event_type: closed
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ ''cams'' in trigger.event.data.path }}'
|
||
variables:
|
||
file_path: '{{ trigger.event.data.path }}'
|
||
folder_name: '{{ trigger.event.data.folder }}'
|
||
is_video: '{{ file_path.endswith(''.mp4'') and not file_path.endswith(''e.mp4'')
|
||
}}'
|
||
is_converted_video: '{{ file_path.endswith(''e.mp4'') }}'
|
||
is_image: '{{ file_path.endswith(''.jpg'') }}'
|
||
common_prompt: Очень кратко опиши, что ты видишь на этом изображении/видео. Твоё
|
||
сообщение должно быть коротким максимум 60 символов, чтобы поместиться в уведомление
|
||
на телефоне. Если это человек, постарайся определить пол. Если это видео опиши
|
||
также направление движения объекта в соответствии с описанием кадра. Не описывай
|
||
неподвижные объекты или здания.
|
||
einfahrt_uid: secret einfahrt_uid
|
||
terrasse_uid: secret terrasse_uid
|
||
garage_uid: secret garage_uid
|
||
einfahrt_prompt: secret einfahrt_prompt
|
||
terrasse_prompt: secret terrasse_prompt
|
||
camera_info: "{% if 'einfahrt' in folder_name %}\n {{ {'icon': '\U0001F3E0',\
|
||
\ 'name': 'Einfahrt', 'uid': einfahrt_uid, 'prompt': einfahrt_prompt} }}\n{%\
|
||
\ elif 'terrasse' in folder_name %}\n {{ {'icon': '\U0001F3E1', 'name': 'Terrasse',\
|
||
\ 'uid': terrasse_uid, 'prompt': terrasse_prompt} }}\n{% elif 'garage' in folder_name\
|
||
\ %}\n {{ {'icon': '\U0001F697', 'name': 'Garage', 'uid': garage_uid} }}\n\
|
||
{% else %}\n {{ {'icon': '\U0001F3C3', 'name': folder_name | title} }}\n{%\
|
||
\ endif %}\n"
|
||
reolink_intent_uri: "{% if camera_info.uid = null %}\n intent:#Intent;launchFlags=0x14000000;component=com.mcu.reolink/com.android.bc.login.WelcomeActivity;S.UID={{\
|
||
\ camera_info.uid }};S.ALMTIME={{now().isoformat()}};S.ALMNAME=Detection;S.DEVNAME=DontCare;S.ALMTYPE=PEOPLE;S.ALMCHN=1;end\n\
|
||
{% else %}\n app://com.mcu.reolink\n{% endif %}\n"
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- '{{ is_video }}'
|
||
sequence:
|
||
- action: shell_command.cam_convert
|
||
data:
|
||
file_in: '{{ file_path }}'
|
||
file_out: '{{ file_path[:-4] }}e.mp4'
|
||
- conditions:
|
||
- '{{ is_converted_video }}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: '{{ camera_info.name }}'
|
||
message: Bewegung erkannt
|
||
data:
|
||
video:
|
||
- file: '{{ file_path }}'
|
||
caption: '{{ camera_info.icon }} *{{ camera_info.name }}*'
|
||
timeout: 1000
|
||
- action: shell_command.cam_remove_file
|
||
data:
|
||
file_in: '{{ file_path[:-5] }}.mp4'
|
||
- if:
|
||
- '{{ camera_info.prompt = null }}'
|
||
then:
|
||
- action: google_generative_ai_conversation.generate_content
|
||
data:
|
||
prompt: '{{ camera_info.prompt }} {{ common_prompt }}'
|
||
filenames:
|
||
- '{{ file_path }}'
|
||
response_variable: response
|
||
- action: notify.mobile_app_as25
|
||
data:
|
||
message: '{{ response.text }}'
|
||
title: '{{ camera_info.name }}'
|
||
data:
|
||
video: /media/nuc{{ file_path[16:] }}
|
||
url: /lovelace/cams
|
||
priority: high
|
||
actions:
|
||
- action: URI
|
||
title: HAss
|
||
uri: /lovelace/cams
|
||
- action: URI
|
||
title: Reolink
|
||
uri: '{{ reolink_intent_uri }}'
|
||
- conditions:
|
||
- '{{ is_image }}'
|
||
sequence:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: '{{ camera_info.name }}'
|
||
message: Bewegung erkannt
|
||
data:
|
||
photo:
|
||
- file: '{{ file_path }}'
|
||
caption: '{{ camera_info.icon }} *{{ camera_info.name }}*'
|
||
- if:
|
||
- '{{ camera_info.prompt = null }}'
|
||
then:
|
||
- action: google_generative_ai_conversation.generate_content
|
||
data:
|
||
prompt: '{{ camera_info.prompt }} {{ common_prompt }}'
|
||
filenames:
|
||
- '{{ file_path }}'
|
||
response_variable: response
|
||
- action: notify.mobile_app_as25
|
||
data:
|
||
message: '{{ response.text }}'
|
||
title: '{{ camera_info.name }} {{ folder_name }}'
|
||
data:
|
||
image: /media/nuc{{ file_path[16:] }}
|
||
url: /lovelace/cams
|
||
priority: high
|
||
actions:
|
||
- action: URI
|
||
title: HAss
|
||
uri: /lovelace/cams
|
||
- action: URI
|
||
title: Reolink
|
||
uri: '{{ reolink_intent_uri }}'
|
||
- id: camera_surveillance_management
|
||
alias: Camera - Surveillance Management
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: group.family
|
||
for: 00:04:00
|
||
- trigger: time_pattern
|
||
minutes: /15
|
||
conditions:
|
||
- '{{ (now().hour < 12 or now().hour > 22) or is_state(''group.family'', ''not_home'')
|
||
}}'
|
||
actions:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.camera_detection_on
|
||
- id: camera_ptz_buttons_control
|
||
alias: Camera - PTZ buttons control
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- button.garage_ptz_up
|
||
- button.garage_ptz_down
|
||
- button.garage_ptz_left
|
||
- button.garage_ptz_right
|
||
- button.garage_ptz_zoom_in
|
||
- button.garage_ptz_zoom_out
|
||
- button.innen_ptz_up
|
||
- button.innen_ptz_down
|
||
- button.innen_ptz_left
|
||
- button.innen_ptz_right
|
||
- button.innen_ptz_zoom_in
|
||
- button.innen_ptz_zoom_out
|
||
actions:
|
||
- delay:
|
||
hours: 0
|
||
minutes: 0
|
||
seconds: 1
|
||
milliseconds: 0
|
||
- action: button.press
|
||
entity_id: button.garage_ptz_stop
|
||
- action: button.press
|
||
entity_id: button.innen_ptz_stop
|
||
- id: tags_wandlicht_toggle
|
||
alias: Tags - Wandlicht toggle
|
||
triggers:
|
||
trigger: event
|
||
event_type: tag_scanned
|
||
event_data:
|
||
tag_id: 4d4d9d64-59ff-4a65-8d8c-d1a088f46599
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.sonoffpow_01
|
||
- id: telegram_control
|
||
alias: Telegram - Control
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data: {}
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data: {}
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/start'' }}'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message: Tastatur aktiviert
|
||
keyboard:
|
||
- /alarm, /tor, /start, /help
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 'Wähle das Symbol [/] unten und dann eine Aktion aus.
|
||
|
||
/start - Zeigt diese Nachricht
|
||
|
||
/help - Zeigt eine Nachricht mit Befehlen an
|
||
|
||
'
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''/help'' }}'
|
||
sequence:
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: '*Tor öffnen/schliessen:*
|
||
|
||
- /tor - Garage öffnen/schliessen
|
||
|
||
- /torteil - Garage teilweise öffnen/schliessen
|
||
|
||
|
||
*Licht ein/aus:*
|
||
|
||
- /wandlicht - Wandlicht
|
||
|
||
- /wohnlicht - Wohnlicht
|
||
|
||
- /kuechenlicht - Küchenlicht
|
||
|
||
- /essecke - Esseckenlicht
|
||
|
||
- /ambiente\_wohnen - Ambiente Wohnzimmer
|
||
|
||
- /ambiente\_kueche - Ambiente Küche
|
||
|
||
|
||
*Rollade öffnen/schliessen:*
|
||
|
||
- /rollade\_1 - Rollade 1
|
||
|
||
- /rollade\_2 - Rollade 2
|
||
|
||
- /rollade\_3 - Rollade 3
|
||
|
||
- /rollade\_4 - Rollade Terrasse
|
||
|
||
|
||
*Allgemein:*
|
||
|
||
- /start - Zeigt die Begrüßungsnachricht
|
||
|
||
- /help - Zeigt eine Nachricht mit Befehlen an
|
||
|
||
'
|
||
- sensor:
|
||
- platform: integration
|
||
unique_id: tuyaplug2_energy
|
||
source: sensor.tuyaplug2_power
|
||
name: Tuyaplug2 Energy
|
||
unit_prefix: k
|
||
round: 2
|
||
utility_meter:
|
||
tuyaplug2_energy_daily:
|
||
unique_id: tuyaplug2_energy_daily
|
||
source: sensor.tuyaplug2_energy
|
||
name: Tuyaplug2 Energy Daily
|
||
cycle: daily
|
||
tuyaplug2_energy_monthly:
|
||
unique_id: tuyaplug2_energy_monthly
|
||
source: sensor.tuyaplug2_energy
|
||
name: Tuyaplug2 Energy Monthly
|
||
cycle: monthly
|
||
tuyaplug2_energy_yearly:
|
||
unique_id: tuyaplug2_energy_yearly
|
||
source: sensor.tuyaplug2_energy
|
||
name: Tuyaplug2 Energy Yearly
|
||
cycle: yearly
|
||
homeassistant:
|
||
customize:
|
||
switch.tuyaplug2:
|
||
friendly_name: TV Board
|
||
icon: mdi:television
|
||
switch.tuyaplug2_childlock:
|
||
friendly_name: Kindersicherung (TV Board)
|
||
icon: mdi:account-lock
|
||
switch.tuyaplug2_overcharge:
|
||
friendly_name: Überladung (TV Board)
|
||
icon: mdi:battery-alert-variant
|
||
sensor.tuyaplug2_current:
|
||
friendly_name: Stromstärke (TV Board)
|
||
sensor.tuyaplug2_power:
|
||
friendly_name: Leistung (TV Board)
|
||
sensor.tuyaplug2_energy:
|
||
friendly_name: Verbrauch (TV Board)
|
||
sensor.tuyaplug2_energy_daily:
|
||
friendly_name: Verbrauch Täglich (TV Board)
|
||
sensor.tuyaplug2_energy_monthly:
|
||
friendly_name: Verbrauch Monatlich (TV Board)
|
||
sensor.tuyaplug2_energy_yearly:
|
||
friendly_name: Verbrauch Jahrlich (TV Board)
|
||
- id: telegram_tuyaplug3
|
||
alias: Telegram - Tuyaplug3
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /ambiente_wohnen
|
||
- trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
command: /ambiente_wohnen
|
||
actions:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.tuyaplug3
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.tuyaplug3
|
||
timeout: 00:00:05
|
||
continue_on_timeout: true
|
||
- action: script.telegram_callback
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message_id: '{{ trigger.event.data.message.message_id if trigger.event.event_type
|
||
== ''telegram_callback'' else 1000 }}'
|
||
message: 💡 {{ state_attr('light.tuyaplug3', 'friendly_name') }} - {{ states('light.tuyaplug3')
|
||
}}
|
||
- id: w10_irrigation_manual_control
|
||
alias: W10 Bewässerung - Manuelle Steuerung
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_boolean.w10_irrigation_manual_run
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.w10_irrigation_manual_run
|
||
state: 'on'
|
||
sequence:
|
||
- action: script.w10_irrigation_run
|
||
data:
|
||
cycle: manual
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.w10_irrigation_stop
|
||
- id: w10_irrigation_scheduled_run
|
||
alias: W10 Bewässerung - Geplanter Start
|
||
mode: single
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.w10_irrigation_cycle1_run_time
|
||
variables:
|
||
cycle: cycle1
|
||
enable_boolean: input_boolean.w10_irrigation_cycle1_enable
|
||
- trigger: time
|
||
at: input_datetime.w10_irrigation_cycle2_run_time
|
||
variables:
|
||
cycle: cycle2
|
||
enable_boolean: input_boolean.w10_irrigation_cycle2_enable
|
||
conditions:
|
||
- condition: template
|
||
alias: Wenn Zyklus aktiviert ist
|
||
value_template: '{{ is_state(enable_boolean, ''on'') }}
|
||
|
||
'
|
||
- condition: state
|
||
entity_id: input_boolean.w10_irrigation_running
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.w10_irrigation_manual_run
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''input_number.w10_irrigation_'' ~ cycle ~ ''_duration'')
|
||
| int(0) > 0 }}'
|
||
- condition: template
|
||
value_template: '{{ states(''switch.sonoffs20_2'') != ''unavailable'' }}'
|
||
alias: Wenn Schalter erreichbar ist
|
||
- condition: template
|
||
alias: Sensorbedingungen (Temp, Feuchtigkeit, Regen)
|
||
value_template: "{% if is_state('input_boolean.w10_irrigation_use_sensor_data',\
|
||
\ 'on') -%}\n {{ states('sensor.rasen_temperature') | float(0) >= states('input_number.w10_irrigation_temperature_threshold')\
|
||
\ | float(0) and\n states('sensor.rasen_moisture') | float(0) <= states('input_number.w10_irrigation_moisture_threshold')\
|
||
\ | float(0) and\n is_state('binary_sensor.mower_rainsensor_triggered','off')\
|
||
\ }}\n{%- else -%}\n True\n{%- endif %}\n"
|
||
actions:
|
||
- action: script.w10_irrigation_run
|
||
data:
|
||
cycle: '{{ cycle }}'
|
||
- id: w10_irrigation_cancel_if_it_rains
|
||
alias: W10 Bewässerung - Abbrechen bei Regen
|
||
mode: single
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.mower_rainsensor_triggered
|
||
to: 'on'
|
||
id: rain_instant
|
||
- trigger: state
|
||
entity_id: binary_sensor.mower_rainsensor_triggered
|
||
to: 'on'
|
||
for:
|
||
minutes: 1
|
||
id: rain_sustained
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.w10_irrigation_running
|
||
state: 'on'
|
||
actions:
|
||
- action: script.w10_irrigation_stop
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: ⛈️ W10 Bewässerung abgebrochen
|
||
message: '{% if trigger.id == ''rain_instant'' %} Regen erkannt - W10 Bewässerung
|
||
sofort abgebrochen. {% else %} Anhaltender Regen - W10 Bewässerung eingestellt.
|
||
{% endif %}
|
||
|
||
'
|
||
- id: wled_integration_manage
|
||
alias: WLED - Integration manage
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: light.sonoffpow_03
|
||
- trigger: time_pattern
|
||
minutes: /15
|
||
conditions: '{{ is_state(''light.sonoffpow_03'', ''on'') or is_state(''light.sonoffpow_03'',
|
||
''off'') }}'
|
||
actions:
|
||
- action: '{{ iif(is_state(''light.sonoffpow_03'', ''on''), ''homeassistant.enable_config_entry'',
|
||
''homeassistant.disable_config_entry'') }}'
|
||
data:
|
||
config_entry_id: 17c5043bacbffb9c30be8a0fab31ff2f
|
||
- id: wled_loop_run
|
||
alias: WLED - Start Effektschleife
|
||
mode: single
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_select.wled_effects_loop
|
||
to: Nacheinander
|
||
- trigger: state
|
||
entity_id:
|
||
- input_select.wled_effects_loop
|
||
to: Zufällig
|
||
actions:
|
||
- action: script.wled_loop
|
||
- id: robi_modus
|
||
alias: Robi - Modus
|
||
initial_state: true
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.robi_fan_speed_list
|
||
actions:
|
||
- action: vacuum.set_fan_speed
|
||
target:
|
||
entity_id: vacuum.robi
|
||
data:
|
||
fan_speed: "{% set speeds = {\n 'Leise':'Silent',\n 'Standard':'Standard',\n\
|
||
\ 'Medium':'Medium',\n 'Turbo':'Turbo',\n 'Sanft':'Gentle',\n 'Auto':'Auto',\n\
|
||
\ }\n%} {{ iif(trigger.to_state.state in speeds, speeds[trigger.to_state.state],\
|
||
\ 'Turbo') }}"
|
||
- id: robi_raumauswahl
|
||
alias: Robi - Raumauswahl
|
||
initial_state: true
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.robi_zone
|
||
from: Raumauswahl
|
||
actions:
|
||
- action: "{% if is_state(\"input_select.robi_zone\",\"EG\") %}\n script.robi_home\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"Küche\") %}\n script.robi_kitchen\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"Wohnzimmer\") %}\n script.robi_living_room\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"Stube\") %}\n script.robi_stube\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"Schlafzimmer\") %}\n script.robi_bedroom\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"Flur\") %}\n script.robi_flur\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"HWR\") %}\n script.robi_hwr\n\
|
||
{% elif is_state(\"input_select.robi_zone\",\"WC\") %}\n script.robi_wc\n{%\
|
||
\ else %} {% endif %}\n"
|
||
- wait_template: '{{is_state(''vacuum.robi'', ''docked'')}}'
|
||
- delay: 00:00:15
|
||
- action: input_select.select_option
|
||
entity_id: input_select.robi_zone
|
||
data:
|
||
option: Raumauswahl
|
||
- action: input_select.select_option
|
||
entity_id: input_select.robi_fan_speed_list
|
||
data:
|
||
option: Turbo
|
||
- id: robi_schedule_cleaning_on_weekdays
|
||
alias: Robi - Schedule cleaning on weekdays
|
||
initial_state: false
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.robi_start_weekdays
|
||
conditions:
|
||
- condition: time
|
||
weekday:
|
||
- mon
|
||
- tue
|
||
- wed
|
||
- thu
|
||
- fri
|
||
actions:
|
||
- action: vacuum.start
|
||
data:
|
||
entity_id: vacuum.robi
|
||
- id: robi_schedule_cleaning_on_weekends
|
||
alias: Robi - Schedule cleaning on weekends
|
||
initial_state: false
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.robi_start_weekends
|
||
conditions:
|
||
- condition: time
|
||
weekday:
|
||
- sat
|
||
- sun
|
||
actions:
|
||
- action: vacuum.start
|
||
data:
|
||
entity_id: vacuum.robi
|
||
- id: robi__notify
|
||
alias: Robi - Notify
|
||
mode: parallel
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: vacuum.robi
|
||
conditions:
|
||
condition: and
|
||
conditions:
|
||
- '{{ trigger.to_state.state != trigger.from_state.state }}'
|
||
- '{{ trigger.from_state.state != ''unavailable'' }}'
|
||
- '{{ trigger.to_state.state != ''unavailable'' }}'
|
||
actions:
|
||
- action: notify.telegram_schick_home
|
||
data:
|
||
title: 🐁 Robi
|
||
message: '{{ state_attr(''vacuum.robi'',''status'') }} <- {{ trigger.from_state.state
|
||
}}'
|