From 8873b4a8c26d1c9cf6b6b5f380d6f024a672d27e Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 15 Oct 2024 18:36:30 +0200 Subject: [PATCH] automatic upload by server --- automation/automations.yaml | 4590 ++--------------------------- automation/telegram_commands.yaml | 14 +- automations.yaml | 58 - configuration.yaml | 2 +- sensor/sensor.yaml | 111 + 5 files changed, 286 insertions(+), 4489 deletions(-) delete mode 100644 automations.yaml diff --git a/automation/automations.yaml b/automation/automations.yaml index 89ba1c1..f174348 100644 --- a/automation/automations.yaml +++ b/automation/automations.yaml @@ -4794,20 +4794,20 @@ target: !secret telegram_chat_bouldern message: > {% set days_ost = [ - {'day': 'Montag', 'value': states('sensor.boulderwelt_ost_monday_avg') | float(70)}, - {'day': 'Dienstag', 'value': states('sensor.boulderwelt_ost_tuesday_avg') | float(70)}, - {'day': 'Mittwoch', 'value': states('sensor.boulderwelt_ost_wednesday_avg') | float(70)}, - {'day': 'Donnerstag', 'value': states('sensor.boulderwelt_ost_thursday_avg') | float(70)}, - {'day': 'Freitag', 'value': states('sensor.boulderwelt_ost_friday_avg') | float(70)} + {'day': 'Montag', 'value': states('sensor.boulderwelt_ost_monday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_ost_monday_avg') | float(70)}, + {'day': 'Dienstag', 'value': states('sensor.boulderwelt_ost_tuesday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_ost_tuesday_avg') | float(70)}, + {'day': 'Mittwoch', 'value': states('sensor.boulderwelt_ost_wednesday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_ost_wednesday_avg') | float(70)}, + {'day': 'Donnerstag', 'value': states('sensor.boulderwelt_ost_thursday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_ost_thursday_avg') | float(70)}, + {'day': 'Freitag', 'value': states('sensor.boulderwelt_ost_friday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_ost_friday_avg') | float(70)} ] %} {% set sorted_days_ost = days_ost | sort(attribute='value') %} {% set days_sued = [ - {'day': 'Montag', 'value': states('sensor.boulderwelt_sued_monday_avg') | float(70)}, - {'day': 'Dienstag', 'value': states('sensor.boulderwelt_sued_tuesday_avg') | float(70)}, - {'day': 'Mittwoch', 'value': states('sensor.boulderwelt_sued_wednesday_avg') | float(70)}, - {'day': 'Donnerstag', 'value': states('sensor.boulderwelt_sued_thursday_avg') | float(70)}, - {'day': 'Freitag', 'value': states('sensor.boulderwelt_sued_friday_avg') | float(70)} + {'day': 'Montag', 'value': states('sensor.boulderwelt_sued_monday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_sued_monday_avg') | float(70)}, + {'day': 'Dienstag', 'value': states('sensor.boulderwelt_sued_tuesday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_sued_tuesday_avg') | float(70)}, + {'day': 'Mittwoch', 'value': states('sensor.boulderwelt_sued_wednesday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_sued_wednesday_avg') | float(70)}, + {'day': 'Donnerstag', 'value': states('sensor.boulderwelt_sued_thursday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_sued_thursday_avg') | float(70)}, + {'day': 'Freitag', 'value': states('sensor.boulderwelt_sued_friday_avg_2h') | float(70), 'day_avg': states('sensor.boulderwelt_sued_friday_avg') | float(70)} ] %} {% set sorted_days_sued = days_sued | sort(attribute='value') %} @@ -4817,19 +4817,19 @@ ] %} {% set sorted_days_weekend_sued = days_sued_wekend | sort(attribute='value') %} - Die besten Boulder-Tage unter der Woche basierend auf der Auslastung der aktuellen Woche: + Die besten Boulder-Tage unter der Woche basierend auf der Auslastung der aktuellen Woche (Zeiten 17 - 19h für Statistiken, dahinter gesamter Tag): - **Ost**: - 1. {{ sorted_days_ost[0].day }} ({{ sorted_days_ost[0].value }} %) - 2. {{ sorted_days_ost[1].day }} ({{ sorted_days_ost[1].value }} %) - 3. {{ sorted_days_ost[2].day }} ({{ sorted_days_ost[2].value }} %) + 1. {{ sorted_days_ost[0].day }} ({{ sorted_days_ost[0].value }}% - Tag: {{ sorted_days_ost[0].day_avg }}%) + 2. {{ sorted_days_ost[1].day }} ({{ sorted_days_ost[1].value }}% - Tag: {{ sorted_days_ost[1].day_avg }}%) + 3. {{ sorted_days_ost[2].day }} ({{ sorted_days_ost[2].value }}% - Tag: {{ sorted_days_ost[2].day_avg }}%) - **Süd**: - 1. {{ sorted_days_sued[0].day }} ({{ sorted_days_sued[0].value }} %) - 2. {{ sorted_days_sued[1].day }} ({{ sorted_days_sued[1].value }} %) - 3. {{ sorted_days_sued[2].day }} ({{ sorted_days_sued[2].value }} %) + 1. {{ sorted_days_sued[0].day }} ({{ sorted_days_sued[0].value }}% - Tag: {{ sorted_days_sued[0].day_avg }}%) + 2. {{ sorted_days_sued[1].day }} ({{ sorted_days_sued[1].value }}% - Tag: {{ sorted_days_sued[1].day_avg }}%) + 3. {{ sorted_days_sued[2].day }} ({{ sorted_days_sued[2].value }}% - Tag: {{ sorted_days_sued[2].day_avg }}%) - - **Wochenende Süd**: {{ sorted_days_weekend_sued[0].day }} ({{ sorted_days_weekend_sued[0].value }} %) + - **Wochenende Süd**: {{ sorted_days_weekend_sued[0].day }} (Tag: {{ sorted_days_weekend_sued[0].value }}%) - service: telegram_bot.send_poll data_template: @@ -4970,6 +4970,101 @@ entity_id: input_number.boulderwelt_sued_sunday_avg value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean') }}" +- id: update_boulderwelt_sensor_average_2h + alias: "Update Boulderwelt Sensor Average 2h" + trigger: + - platform: time + at: "19:00:00" + conditions: + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + action: + - choose: + - conditions: + - condition: time + weekday: + - mon + sequence: + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_ost_monday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_ost_level_mean_2h') }}" + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_sued_monday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean_2h') }}" + + - conditions: + - condition: time + weekday: + - tue + sequence: + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_ost_tuesday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_ost_level_mean_2h') }}" + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_sued_tuesday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean_2h') }}" + + - conditions: + - condition: time + weekday: + - wed + sequence: + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_ost_wednesday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_ost_level_mean_2h') }}" + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_sued_wednesday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean_2h') }}" + + - conditions: + - condition: time + weekday: + - thu + sequence: + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_ost_thursday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_ost_level_mean_2h') }}" + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_sued_thursday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean_2h') }}" + + - conditions: + - condition: time + weekday: + - fri + sequence: + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_ost_friday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_ost_level_mean_2h') }}" + - service: input_number.set_value + continue_on_error: true + data: + entity_id: input_number.boulderwelt_sued_friday_avg_2h + value: "{{ states('sensor.boulderwelt_munchen_sued_level_mean_2h') }}" + - id: turn_on_fridge_for_meetings alias: "Turn on fridge for meetings" initial_state: true @@ -6288,23 +6383,53 @@ entity_id: light.deckenlampe_keller - id: automatic_ha_updates - alias: "Automatic HA Updates" - use_blueprint: - path: edwardtfn/auto_update_scheduled.yaml - input: - schedule_entity: schedule.homeassistant_updates - restart_bool: true - actions_pre_restart: - - service: hassio.addon_restart - metadata: {} - data: - addon: a0d7b954_ssh - actions_pre_update: - - service: notify.telegram_fabian - metadata: {} - data: - title: Homeassistant Updates werden installiert - message: "{{ updates_list }}" + alias: "Install All Updates on Sunday Night" + description: Sends a Telegram message with available updates for integrations and installs them every Sunday night at 2 AM. + trigger: + - platform: time + at: "02:00:00" + condition: + condition: and + conditions: + - condition: time + weekday: + - sun + action: + - service: telegram_bot.send_message + data_template: + target: !secret telegram_chat_fabian + disable_notification: true + message: > + Updates will be installed for the following: + + {% set integration_updates = states.update | selectattr('entity_id', 'search', 'update.') | selectattr('state', 'eq', 'on') | list %} + {% set addon_updates = state_attr('sensor.supervisor_updates', 'addons') %} + + {% if integration_updates | length > 0 %} + **Integrations**: + {%- for entity in integration_updates -%} + - {{ state_attr(entity.entity_id, 'friendly_name') }} ({{ entity.entity_id }}) + {%- endfor %} + {% else %} + No integration updates available. + {% endif %} + + {% if addon_updates is not none and addon_updates | length > 0 %} + **Add-ons**: + {%- for addon in addon_updates -%} + - {{ addon.name }} (Latest: {{ addon.version_latest }}) + {%- endfor %} + {% else %} + No add-on updates available. + {% endif %} + - delay: "00:05:00" + - service: homeassistant.update_entity + target: + entity_id: all + - service: hassio.addon_update + data: + addon: all + mode: single - id: incoming_call_fabian alias: "Incoming Call Fabian" @@ -6649,6 +6774,10 @@ - service: switch.turn_on data: entity_id: switch.schloss + - delay: "00:00:03" + - service: switch.turn_on + data: + entity_id: switch.schloss - id: turn_schloss_off_after_turning_on alias: Turn Schloss off after turning on @@ -6658,7 +6787,7 @@ entity_id: switch.schloss to: "on" action: - - delay: "00:00:01" + - delay: "00:00:02" - service: switch.turn_off data: entity_id: switch.schloss @@ -6812,4391 +6941,4 @@ entity_id: media_player.kuche_lautsprecher is_volume_muted: false - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: is_volume_muted - state: "false" - - condition: or - conditions: - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: media_title - state: "Advertisement" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.fabians_lautsprecher - is_volume_muted: true - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: media_title - state: "Advertisement" - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.fabians_lautsprecher - attribute: is_volume_muted - state: "true" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.fabians_lautsprecher - is_volume_muted: false - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: is_volume_muted - state: "false" - - condition: or - conditions: - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: media_title - state: "Advertisement" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.samuels_lautsprecher - is_volume_muted: true - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: media_title - state: "Advertisement" - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.samuels_lautsprecher - attribute: is_volume_muted - state: "true" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.samuels_lautsprecher - is_volume_muted: false - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: is_volume_muted - state: "false" - - condition: or - conditions: - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: media_title - state: "Advertisement" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.wohnzimmer_tv_cast - is_volume_muted: true - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: media_title - state: "Advertisement" - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.wohnzimmer_tv_cast - attribute: is_volume_muted - state: "true" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.wohnzimmer_tv_cast - is_volume_muted: false - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.mini_gruppe - attribute: is_volume_muted - state: "false" - - condition: or - conditions: - - condition: state - entity_id: media_player.mini_gruppe - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.mini_gruppe - attribute: media_title - state: "Advertisement" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.mini_gruppe - is_volume_muted: true - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.mini_gruppe - attribute: media_title - state: "Advertisement" - - condition: state - entity_id: media_player.mini_gruppe - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.mini_gruppe - attribute: is_volume_muted - state: "true" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.mini_gruppe - is_volume_muted: false - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.keller_tv_cast - attribute: is_volume_muted - state: "false" - - condition: or - conditions: - - condition: state - entity_id: media_player.keller_tv_cast - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.keller_tv_cast - attribute: media_title - state: "Advertisement" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.keller_tv_cast - is_volume_muted: true - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.keller_tv_cast - attribute: media_title - state: "Advertisement" - - condition: state - entity_id: media_player.keller_tv_cast - attribute: media_title - state: "Spotify" - - condition: state - entity_id: media_player.keller_tv_cast - attribute: is_volume_muted - state: "true" - sequence: - - service: media_player.volume_mute - data: - entity_id: media_player.keller_tv_cast - is_volume_muted: false - -- id: turn_off_devices_after_power_loss - alias: Turn off devices after power loss - initial_state: true - trigger: - - platform: state - entity_id: - - light.bett_gluhbirne - from: "unavailable" - to: "on" - action: - - service: light.turn_on - data: - entity_id: - - light.bett_gluhbirne - -- id: low_battery_thermostats - alias: Low battery thermostats - initial_state: true - trigger: - - platform: state - entity_id: - - binary_sensor.bad_battery_state - - binary_sensor.fabian_s_zimmer_battery_state - from: "off" - to: "on" - for: - hours: 4 - - platform: state - entity_id: - - climate.wohnzimmer - - climate.samuel_s_zimmer - to: "unavailable" - for: - hours: 2 - condition: - condition: not - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.low_battery_thermostats.attributes.last_triggered) | int > 43200 }}" - - condition: state - entity_id: climate.bad - state: "unavailable" - - condition: state - entity_id: climate.fabian_s_zimmer - state: "unavailable" - action: - - service: notify.telegram_fabian - data_template: - message: > - Die Batterie im Thermostat - {% if is_state('climate.wohnzimmer', 'unavailable') %} - Wohnzimmer - {% endif %} - {% if is_state('climate.samuel_s_zimmer', 'unavailable') %} - Samuels Zimmer - {% endif %} - {% if is_state('binary_sensor.fabian_s_zimmer_battery_state', 'on') %} - fabian_s_zimmer - {% endif %} - {% if is_state('binary_sensor.bad_battery_state', 'on') %} - Bad - {% endif %} - ist - {% if is_state('binary_sensor.fabian_s_zimmer_battery_state', 'on') or is_state('binary_sensor.bad_battery_state', 'on') %} - bald - {% else %} - KOMPLETT - {% endif %} - leer. Bitte auswechseln! Luftfeuchtigkeitsautomationen & Temperatureinstellungen funktionieren so lange nur eingeschränkt. - - service: notify.telegram_samuel - data_template: - message: > - Die Batterie im Thermostat - {% if is_state('climate.wohnzimmer', 'unavailable') %} - Wohnzimmer - {% endif %} - {% if is_state('climate.samuel_s_zimmer', 'unavailable') %} - Samuels Zimmer - {% endif %} - {% if is_state('binary_sensor.fabian_s_zimmer_battery_state', 'on') %} - fabian_s_zimmer - {% endif %} - {% if is_state('binary_sensor.bad_battery_state', 'on') %} - Bad - {% endif %} - ist - {% if is_state('binary_sensor.fabian_s_zimmer_battery_state', 'on') or is_state('binary_sensor.bad_battery_state', 'on') %} - bald - {% else %} - KOMPLETT - {% endif %} - leer. Bitte auswechseln! Luftfeuchtigkeitsautomationen & Temperatureinstellungen funktionieren so lange nur eingeschränkt. - -- id: cast_ha_to_tv_if_idle - alias: Cast HA to TV if idleing - trigger: - - platform: state - entity_id: media_player.wohnzimmer_tv - to: - - "idle" - - "standby" - for: - minutes: 3 - action: - service: cast.show_lovelace_view - data: - entity_id: media_player.wohnzimmer_tv_cast - view_path: cast - -- id: fritzbox_public_ip_change - alias: Fritzbox Public IP Change - initial_state: true - trigger: - - platform: state - entity_id: sensor.fritz_box_3490_external_ip - not_from: - - "unavailable" - - "unknown" - - "" - - "Unknown" - condition: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.fritzbox_no_internet_access.attributes.last_triggered) | int > 360 }}" - - condition: not - conditions: - - condition: state - entity_id: sensor.fritz_box_3490_external_ip - state: "unavailable" - - condition: state - entity_id: sensor.fritz_box_3490_external_ip - state: "" - - condition: state - entity_id: sensor.fritz_box_3490_external_ip - state: "unknown" - action: - - service: notify.telegram_fabian - data: - message: "Öffentliche IP hat sich geändert zu {{ states.sensor.fritz_box_3490_external_ip.state }}" - -# - id: turn_on_fritzbox_wifi_if_miwifi_is_off -# alias: Turn on Fritzbox Wifi if Miwifi is off -# initial_state: true -# trigger: -# - platform: state -# entity_id: sbinary_sensor.xiaomi_abd8_wan_state -# state: "not_connected" -# - platform: template -# value_template: "{{ if not is_state('sbinary_sensor.xiaomi_abd8_wan_state', 'connected'}}" -# condition: -# - condition: template -# value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.turn_on_fritzbox_wifi_if_miwifi_is_off.attributes.last_triggered) | int > 360 }}" -# - condition: not -# conditions: -# - condition: state -# entity_id: 'binary_sensor.fritz_box_3490_connection' -# state: 'not_connected' -# action: -# - service: notify.telegram_fabian -# data: -# message: 'Miwifi hat kein Internet' - -- id: fritzbox_no_internet_access - alias: Fritzbox no Internet access - initial_state: true - trigger: - - platform: state - entity_id: binary_sensor.fritz_box_3490_connection - from: "Connected" - to: "Not_Connected" - for: - seconds: 15 - condition: - condition: and - conditions: - - condition: time - after: "10:30:00" - before: "22:30:00" - - condition: state - entity_id: "input_boolean.leiser_modus" - state: "off" - - condition: or - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: state - entity_id: person.fabian - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.fritzbox_no_internet_access.attributes.last_triggered) | int > 1200 }}" - action: - # - service: rest_command.assistant_broadcast - # data: - # command: Die Fritzbox hat keine Internet Verbindung und wird nun neugestartet. - # user: "homeassistant" - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: - - media_player.fabians_lautsprecher - - media_player.wohnzimmer_uhr - - media_player.kuche_lautsprecher - - media_player.samuels_lautsprecher - message: "Die Fritzbox hat keine Internet Verbindung und wird nun neugestartet." - - service: fritz.reboot - data: - host: 192.168.178.1 - - service: automation.turn_on - data: - entity_id: automation.fritzbox_internet_access_returned - - service: automation.turn_off - data: - entity_id: automation.fritzbox_no_internet_access - -- id: fritzbox_internet_access_returned - alias: Fritzbox Internet access returned - initial_state: false - trigger: - - platform: state - entity_id: binary_sensor.fritz_box_3490_connection - from: "Not_Connected" - to: "Connected" - condition: - condition: and - conditions: - - condition: time - after: "10:30:00" - before: "22:30:00" - - condition: state - entity_id: "input_boolean.leiser_modus" - state: "off" - action: - - choose: - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: state - entity_id: person.fabian - state: home - sequence: - # - service: rest_command.assistant_broadcast - # data: - # command: Die Internetverbindung ist wiederhergestellt. - # user: "homeassistant" - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: - - media_player.fabians_lautsprecher - - media_player.wohnzimmer_uhr - - media_player.kuche_lautsprecher - - media_player.samuels_lautsprecher - message: "Die Internetverbindung ist wiederhergestellt." - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: state - entity_id: person.fabian - state: home - sequence: - - service: telegram_bot.send_message - data: - target: !secret telegram_chat_fabian - message: "Die Fritzbox Internet Verbundung wurde verloren und wurde soeben wiederhergestellt." - - service: automation.turn_on - data: - entity_id: automation.fritzbox_no_internet_access - - service: automation.turn_off - data: - entity_id: automation.fritzbox_internet_access_returned - -# - id: internet_speed_test_poor_fabian -# alias: Internet Speed Test Poor Fabian -# -# initial_state: true -# trigger: -# - platform: template -# value_template: "{{ states('sensor.speedtest_download')|float < 40 }}" -# condition: -# - condition: template -# value_template: "{{ states.device_tracker.google_maps_112174659110860535869.state == 'home' }}" -# action: -# - service: notify.telegram_fabian -# data: -# message: 'Die Internetgeschwindigkeit ist aktuell langsam ( {{ states.sensor.speedtest_download }} Mbit/s ). Eventuell die Fritzbox neustarten?' - -# - id: internet_speed_test_poor_fabian -# alias: Internet Speed Test Poor samuel -# -# initial_state: true -# trigger: -# - platform: template -# value_template: "{{ states('sensor.speedtest_download')|float < 30 }}" -# condition: -# - condition: template -# value_template: "{{ states.device_tracker.google_maps_112056758146194246561.state == 'home' }}" -# - condition: state -# entity_id: device_tracker.md3f9bmc -# state: home -# action: -# - service: notify.telegram_samuel -# data: -# message: 'Die Internetgeschwindigkeit ist aktuell langsam. Eventuell die Fritzbox neustarten?' - -# - id: update_tasmota -# alias: Update Tasmota -# initial_state: true -# trigger: -# - platform: numeric_state -# entity_id: sensor.latest_tasmota -# above: 0 -# action: -# - service: notify.telegram_fabian -# data: -# message: 'Alle Tasmota Geräte werden aktualisiert auf Version {{ states.sensor.latest_tasmota.state }}.' -# - service: mqtt.publish -# data: -# topic: cmnd/tasmotas/Upgrade -# payload: 1 - -- id: deckenlampe_button_hold - alias: Deckenlampe Button Hold - initial_state: true - trigger: - - platform: device - domain: tasmota - device_id: d75263b1d81c803aac073abd2257aa2d - type: button_long_press - subtype: button_1 - discovery_id: 68C63A87B4BF_button_1_HOLD - - platform: event - event_type: ios.action_fired - event_data: - actionName: "Light Livingroom" - action: - - choose: - - conditions: - - condition: or - conditions: - - condition: state - entity_id: light.leds_wohnzimmer - state: "off" - - condition: state - entity_id: light.leds_wohnzimmer - state: "unavailable" - - condition: or - conditions: - - condition: state - entity_id: light.stehlampe - state: "off" - - condition: state - entity_id: light.stehlampe - state: "unavailable" - - condition: or - conditions: - - condition: state - entity_id: light.leds_wohnzimmer_tv - state: "off" - - condition: state - entity_id: light.leds_wohnzimmer_tv - state: "unavailable" - sequence: - # - service: light.turn_off - # data: - # area_id: 7c05afe47efd44f5a0a064769ad6e105 # Wohnzimmer - # transition: 2 - # brightness: 255 - - service: light.turn_on - data: - entity_id: light.stehlampe - transition: 2 - brightness: 255 - color_temp: 225 - - service: light.turn_on - data: - entity_id: light.leds_wohnzimmer - transition: 2 - brightness: 255 - rgb_color: [255, 255, 255] - - choose: - - conditions: - - condition: or - conditions: - - condition: state - entity_id: light.leds_wohnzimmer - state: "on" - for: - seconds: 2 - - condition: state - entity_id: light.stehlampe - state: "on" - for: - seconds: 2 - - condition: state - entity_id: light.leds_wohnzimmer_tv - state: "on" - for: - seconds: 2 - sequence: - - service: light.turn_off - data: - area_id: 7c05afe47efd44f5a0a064769ad6e105 # Wohnzimmer - -- id: deckenlampe_button_double_press - alias: Deckenlampe Button double press - initial_state: true - trigger: - - platform: device - domain: tasmota - device_id: d75263b1d81c803aac073abd2257aa2d - type: button_double_press - subtype: button_1 - discovery_id: 68C63A87B4BF_button_1_DOUBLE - action: - - choose: - - conditions: - - condition: state - entity_id: switch.fernseher - state: "on" - sequence: - - service: switch.turn_off - data: - entity_id: switch.fernseher - - choose: - - conditions: - - condition: state - entity_id: switch.fernseher - state: "off" - sequence: - - service: switch.turn_on - data: - entity_id: switch.fernseher - -- id: keller_power_strip_double_press - alias: Keller power strip double press - initial_state: true - trigger: - - platform: device - domain: tasmota - device_id: ebf8e0a468385963dc6561b555ce4e4f - type: button_double_press - subtype: button_1 - discovery_id: 24A16007D751_button_1_DOUBLE - action: - - choose: - - conditions: - - condition: state - entity_id: light.deckenlampe_keller - state: "on" - sequence: - - service: light.turn_off - data: - entity_id: light.deckenlampe_keller - - choose: - - conditions: - - condition: state - entity_id: light.deckenlampe_keller - state: "off" - sequence: - - service: light.turn_on - data: - entity_id: light.deckenlampe_keller - -- id: lichtschalter_button_hold - alias: Lichtschalter Button Hold - initial_state: true - trigger: - - platform: device - domain: tasmota - device_id: 564e0bea23153d99c590e8fe2ef83464 - type: button_long_press - subtype: button_1 - discovery_id: 68C63AA72808_button_1_HOLD - - platform: event - event_type: ios.action_fired - event_data: - actionName: "Light Sleepingroom" - action: - - choose: - - conditions: - - condition: and - conditions: - - condition: or - conditions: - - condition: state - entity_id: light.bett_gluhbirne - state: "off" - - condition: state - entity_id: light.bett_gluhbirne - state: "unavailable" - - condition: or - conditions: - - condition: state - entity_id: light.mibedsidelamp2_22e2 - state: "off" - - condition: state - entity_id: light.mibedsidelamp2_22e2 - state: "unavailable" - - condition: or - conditions: - - condition: state - entity_id: light.leds_tisch - state: "off" - - condition: state - entity_id: light.leds_tisch - state: "unavailable" - - condition: or - conditions: - - condition: state - entity_id: light.regal - state: "off" - - condition: state - entity_id: light.regal - state: "unavailable" - sequence: - - service: light.turn_on - data: - entity_id: light.leds_tisch - brightness: 255 - transition: 2 - - service: light.turn_on - data: - entity_id: - - light.bett_gluhbirne - - light.mibedsidelamp2_22e2 - brightness: 255 - color_temp: 225 - transition: 2 - - service: light.turn_on - entity_id: light.regal - - choose: - - conditions: - - condition: or - conditions: - - condition: state - entity_id: light.leds_tisch - state: "on" - for: - seconds: 2 - - condition: state - entity_id: light.bett_gluhbirne - state: "on" - for: - seconds: 2 - - condition: state - entity_id: light.regal - state: "on" - for: - seconds: 2 - - condition: state - entity_id: light.mibedsidelamp2_22e2 - state: "on" - for: - seconds: 2 - sequence: - - service: light.turn_off - data: - area_id: - - 33e9a108bf1948e5848f156e0851d50c # Fabians Zimmer - -- id: lichtschalter_button_double_press - alias: Lichtschalter Button double press - initial_state: true - trigger: - - platform: device - domain: tasmota - device_id: 564e0bea23153d99c590e8fe2ef83464 - type: button_double_press - subtype: button_1 - discovery_id: 68C63AA72808_button_1_DOUBLE - action: - - choose: - - conditions: - - condition: state - entity_id: switch.fabian_schreibtisch - state: "on" - sequence: - - service: switch.turn_off - data: - entity_id: switch.fabian_schreibtisch - - choose: - - conditions: - - condition: state - entity_id: switch.fabian_schreibtisch - state: "off" - sequence: - - service: switch.turn_on - data: - entity_id: switch.fabian_schreibtisch - -- id: restart_bluetooth_on_tv - alias: Restart Bluetooth on TV - initial_state: false - trigger: - - platform: state - entity_id: automation.restart_bluetooth_on_tv - to: "on" - condition: - condition: and - conditions: - - condition: state - entity_id: device_tracker.wohnzimmer_tv - state: "home" - action: - - service: androidtv.adb_command - data: - entity_id: media_player.wohnzimmer_tv - command: "settings put global bluetooth_disabled_profiles 0" - - delay: "00:00:01" - - service: androidtv.adb_command - data: - entity_id: media_player.wohnzimmer_tv - command: "settings put global bluetooth_disabled_profiles 1" - - service: automation.turn_off - data: - entity_id: automation.restart_bluetooth_on_tv - -- id: notify_for_high_humidity - alias: Notify for high humidity - trigger: - - platform: numeric_state - entity_id: - - climate.samuel_s_zimmer - - climate.wohnzimmer - - climate.fabian_s_zimmer - - climate.bad - attribute: current_humidity - above: 60 - - platform: state - entity_id: person.fabian - from: "not_home" - to: "home" - for: - minutes: 3 - - platform: state - entity_id: person.samuel - from: "not_home" - to: "home" - for: - minutes: 3 - condition: - condition: and - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_for_high_humidity.attributes.last_triggered) | int > 7200 }}" - - condition: not - conditions: - - condition: state - entity_id: automation.notify_for_high_humidity - attribute: last_triggered - state: none - - condition: or - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: state - entity_id: person.fabian - state: home - - condition: or - conditions: - - condition: numeric_state - entity_id: climate.samuel_s_zimmer - attribute: current_humidity - above: 60 - - condition: numeric_state - entity_id: climate.wohnzimmer - attribute: current_humidity - above: 60 - - condition: numeric_state - entity_id: climate.fabian_s_zimmer - attribute: current_humidity - above: 60 - - condition: numeric_state - entity_id: climate.bad - attribute: current_humidity - above: 60 - - condition: or - conditions: - - condition: and - conditions: - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: time - before: "21:30:00" - - condition: time - after: "08:00:00" - - condition: and - conditions: - - condition: state - entity_id: binary_sensor.workday_sensor - state: "off" - - condition: time - before: "22:00:00" - - condition: time - after: "11:00:00" - action: - - parallel: - - choose: - - conditions: - - condition: state - entity_id: media_player.kuche_lautsprecher - state: "off" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.kuche_lautsprecher - - delay: 00:00:05 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.kuche_lautsprecher - message: > - {% if (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) and (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Fabi und Samuel - {% elif (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) %} - Willkommen zurück Fabi. - {% elif (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Samuel. - {% endif %} - Die Luftfeuchtigkeit ist zu hoch im Raum - {% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 60 %} - von Samuel, - {% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 60 %} - von Fabi, - {% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %} - Wohnzimmer, - {% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 60 %} - Bad, - {% endif %} - Bitte lüften. - - delay: 00:00:05 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.kuche_lautsprecher - - choose: - - conditions: - - condition: state - entity_id: media_player.fabians_lautsprecher - state: "off" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240 }}" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.fabians_lautsprecher - - delay: 00:00:05 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.fabians_lautsprecher - message: > - {% if (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) and (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Fabi und Samuel - {% elif (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) %} - Willkommen zurück Fabi. - {% elif (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Samuel. - {% endif %} - Die Luftfeuchtigkeit ist zu hoch im Raum - {% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 60 %} - von Samuel, - {% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 60 %} - von Fabi, - {% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %} - Wohnzimmer, - {% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 60 %} - Bad, - {% endif %} - Bitte lüften. - - delay: 00:00:05 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.fabians_lautsprecher - - choose: - - conditions: - - condition: state - entity_id: media_player.wohnzimmer_uhr - state: "off" - - condition: state - entity_id: media_player.wohnzimmer_tv - state: "unavailable" - - condition: state - entity_id: input_boolean.gast_modus - state: "off" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.wohnzimmer_uhr - - delay: 00:00:05 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.wohnzimmer_uhr - message: > - {% if (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) and (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Fabi und Samuel - {% elif (as_timestamp(now()) - as_timestamp(states.person.fabian.last_changed) | int < 240) %} - Willkommen zurück Fabi. - {% elif (as_timestamp(now()) - as_timestamp(states.person.samuel.last_changed) | int < 240) %} - Willkommen zurück Samuel. - {% endif %} - Die Luftfeuchtigkeit ist zu hoch im Raum - {% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 60 %} - von Samuel, - {% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 60 %} - von Fabi, - {% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %} - Wohnzimmer, - {% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 60 %} - Bad, - {% endif %} - Bitte lüften. - - delay: 00:00:03 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.wohnzimmer_uhr - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_tv - state: "unavailable" - sequence: - - service: notify.wohnzimmer_tv - continue_on_error: true - data_template: - message: > - Die Luftfeuchtigkeit ist zu hoch im Raum - {% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 60 %} - von Samuel, - {% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 60 %} - von Fabi, - {% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %} - Wohnzimmer, - {% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 60 %} - Bad, - {% endif %} - Bitte lüften. - -- id: notify_for_extreme_high_humidity - alias: Notify for extreme high humidity - trigger: - - platform: numeric_state - entity_id: - - climate.samuel_s_zimmer - - climate.wohnzimmer - - climate.fabian_s_zimmer - - climate.bad - attribute: current_humidity - above: 69 - condition: - - condition: time - after: "06:00:00" - - condition: state - entity_id: person.samuel - state: not_home - - condition: state - entity_id: person.fabian - state: not_home - - condition: state - entity_id: "input_boolean.abwesend_modus" - state: "off" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_for_extreme_high_humidity.attributes.last_triggered) | int > 32400 }}" - action: - - choose: - - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 89000 - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: > - Achtung, sehr hohe Luftfeuchtigkeit:{% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 67 %} - - Luftfeuchtigkeit Samuels Zimmer{{ states.climate.samuel_s_zimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 67 %} Luftfeuchtigkeit Wohnzimmer{{ states.climate.wohnzimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 67 %} Luftfeuchtigkeit fabian_s_zimmer{{ states.climate.fabian_s_zimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 67 %} Luftfeuchtigkeit Bad{{ states.climate.bad.attributes.current_humidity }} %.{% endif %} - - choose: - - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 89000 - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - message: > - Achtung, sehr hohe Luftfeuchtigkeit:{% if (states.climate.samuel_s_zimmer.attributes.current_humidity) > 67 %} - - Luftfeuchtigkeit Samuels Zimmer{{ states.climate.samuel_s_zimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.wohnzimmer.attributes.current_humidity) > 67 %} Luftfeuchtigkeit Wohnzimmer{{ states.climate.wohnzimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.fabian_s_zimmer.attributes.current_humidity) > 67 %} Luftfeuchtigkeit fabian_s_zimmer{{ states.climate.fabian_s_zimmer.attributes.current_humidity }} %.{% endif %} - {% if (states.climate.bad.attributes.current_humidity) > 67 %} Luftfeuchtigkeit Bad{{ states.climate.bad.attributes.current_humidity }} %.{% endif %} - -- id: detect_if_coal_lighter_is_currently_active - alias: Detect if coal lighter is currently active - initial_state: true - mode: single - trigger: - - platform: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 380 - below: 1000 - for: - seconds: 35 - - platform: state - entity_id: switch.kohleanzunder - to: "on" - for: - minutes: 1 - - platform: state - entity_id: input_button.kohleanzunder_timer - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_coal_lighter_is_currently_active.attributes.last_triggered) | int > 1080 }}" - - condition: or - conditions: - - condition: and - conditions: - - condition: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 380 - - condition: state - entity_id: switch.kohleanzunder - state: "on" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.input_button.kohleanzunder_timer.state) | int < 30 }}" - action: - - service: automation.turn_off - data: - entity_id: - - automation.detect_if_washing_machine_is_currently_active - - choose: - # IF 5 friends are there - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: state - entity_id: person.fabian - state: "JUZ" - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.flo - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_5friends - message: "Kohleanzünder wurde eingeschaltet." - # ELSEIF only K&A are there - - conditions: - - condition: or - conditions: - - condition: and - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.kai - state: home - - condition: state - entity_id: person.adri - state: home - - condition: not - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - - condition: state - entity_id: person.kai - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_afk - message: "Kohleanzünder wurde eingeschaltet." - inline_keyboard: - - "Dauer:/remaining_time" - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.adri - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_adrian - message: "Kohleanzünder wurde eingeschaltet." - inline_keyboard: - - "Dauer:/remaining_time" - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Kohleanzünder wurde eingeschaltet." - inline_keyboard: - - "Dauer:/remaining_time" - - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: home - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - message: "Kohleanzünder wurde eingeschaltet." - inline_keyboard: - - "Dauer:/remaining_time" - # ELSE only notify fabian - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Kohleanzünder wurde eingeschaltet." - inline_keyboard: - - "Dauer:/remaining_time" - #- delay: "00:09:00" - #- choose: - # # IF 5 friends are there - # - conditions: - # - condition: or - # conditions: - # - condition: state - # entity_id: person.flo - # state: home - # - condition: state - # entity_id: person.maxi - # state: home - # - condition: state - # entity_id: person.fabian - # state: "JUZ" - # sequence: - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_5friends - # message: "Bitte Kohle wenden." - # - service: notify.mobile_app_pixel_8_pro - # data: - # message: "Bitte Kohle wenden" - # data: - # push: - # sound: - # name: "default" - # critical: 1 - # volume: 0.7 - # # ELSEIF only K&A are there - # - conditions: - # - condition: or - # conditions: - # - condition: and - # conditions: - # - condition: and - # conditions: - # - condition: state - # entity_id: person.kai - # state: home - # - condition: state - # entity_id: person.adri - # state: home - # - condition: not - # conditions: - # - condition: state - # entity_id: person.flo - # state: home - # - condition: state - # entity_id: person.maxi - # state: home - # - condition: and - # conditions: - # - condition: state - # entity_id: person.fabian - # state: "Kai-Adri" - # - condition: state - # entity_id: person.adri - # state: "Kai-Adri" - # - condition: state - # entity_id: person.kai - # state: "Kai-Adri" - # sequence: - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_afk - # message: "Bitte Kohle wenden." - # - service: notify.mobile_app_pixel_8_pro - # data: - # message: "Bitte Kohle wenden" - # data: - # push: - # sound: - # name: "default" - # critical: 1 - # volume: 0.7 - # - conditions: - # - condition: or - # conditions: - # - condition: state - # entity_id: person.adri - # state: home - # - condition: and - # conditions: - # - condition: state - # entity_id: person.fabian - # state: "Kai-Adri" - # - condition: state - # entity_id: person.adri - # state: "Kai-Adri" - # sequence: - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_adrian - # message: "Bitte Kohle wenden." - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_fabian - # message: "Bitte Kohle wenden." - # - service: notify.mobile_app_pixel_8_pro - # data: - # message: "Bitte Kohle wenden" - # data: - # push: - # sound: - # name: "default" - # critical: 1 - # volume: 0.7 - # # ELSE only notify fabian - # - conditions: - # - condition: and - # conditions: - # - condition: state - # entity_id: person.samuel - # state: home - # - condition: not - # conditions: - # - condition: state - # entity_id: person.fabian - # state: home - # sequence: - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_samuel - # message: "Bitte Kohle wenden." - # default: - # - service: telegram_bot.send_message - # data_template: - # target: !secret telegram_chat_fabian - # message: "Bitte Kohle wenden." - # - service: notify.mobile_app_pixel_8_pro - # data: - # message: "Bitte Kohle wenden" - # data: - # push: - # sound: - # name: "default" - # critical: 1 - # volume: 0.7 - #- choose: - # - conditions: - # - condition: not - # conditions: - # - condition: state - # entity_id: media_player.keller_tv - # state: unavailable - # sequence: - # - service: androidtv.adb_command - # continue_on_error: true - # data: - # entity_id: media_player.keller_tv - # command: "pm clear com.tcl.videoplayer" - # - service: androidtv.adb_command - # continue_on_error: true - # data: - # entity_id: media_player.keller_tv - # command: "am start -a android.intent.action.VIEW -d /sdcard/jonny_rozay_shisha_smoke.mp4 -t video/mp4" - # # - service: notify.keller_tv - # # continue_on_error: true - # # data: - # # message: "Bitte Kohle wenden." - - delay: "00:06:00" - # - choose: - # - conditions: - # - condition: not - # conditions: - # - condition: state - # entity_id: media_player.keller_tv - # state: unavailable - # sequence: - # - service: notify.keller_tv - # continue_on_error: true - # data: - # message: "Der Eisschlauch kann schon mal geholt werden." - - choose: - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.fabian - state: home - - condition: state - entity_id: person.fabian - state: JUZ - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_coal_lighter_is_currently_active.attributes.last_triggered) | int > 14400 }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Der Eisschlauch kann schon mal geholt werden." - - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_coal_lighter_is_currently_active.attributes.last_triggered) | int > 14400 }}" - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: home - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - message: "Der Eisschlauch kann schon mal geholt werden." - - delay: "00:02:00" - - service: switch.turn_off - data: - entity_id: switch.kohleanzunder - - delay: "00:01:00" - - choose: - # IF 5 friends are there - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: state - entity_id: person.fabian - state: "JUZ" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_5friends - message: "Die Kohle sollte fertig sein! Strom ausschalten nicht vergessen." - - service: notify.mobile_app_pixel_8_pro - data: - message: "Die Kohle sollte fertig sein! Strom ausschalten nicht vergessen." - data: - push: - sound: - name: "default" - critical: 1 - volume: 0.7 - # ELSEIF only K&A are there - - conditions: - - condition: or - conditions: - - condition: and - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.kai - state: home - - condition: state - entity_id: person.adri - state: home - - condition: not - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - - condition: state - entity_id: person.kai - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_afk - message: "Die Kohle sollte fertig sein! Strom ausschalten nicht vergessen." - - service: notify.mobile_app_pixel_8_pro - data: - message: "Die Kohle sollte fertig sein!" - data: - push: - sound: - name: "default" - critical: 1 - volume: 0.7 - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.adri - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_adrian - message: "Die Kohle sollte fertig sein! Strom wurde ausgeschaltet." - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Die Kohle sollte fertig sein! Strom wurde ausgeschaltet." - - service: notify.mobile_app_pixel_8_pro - data: - message: "Die Kohle sollte fertig sein!" - data: - push: - sound: - name: "default" - critical: 1 - volume: 0.7 - - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: home - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - message: "Die Kohle sollte fertig sein! Strom wurde ausgeschaltet." - # ELSE only notify fabian - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Die Kohle sollte fertig sein! Strom wurde ausgeschaltet." - - service: notify.mobile_app_pixel_8_pro - data: - message: "Die Kohle sollte fertig sein!" - data: - push: - sound: - name: "default" - critical: 1 - volume: 0.7 - - service: automation.turn_on - data: - entity_id: - - automation.detect_if_washing_machine_is_currently_active - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: media_player.keller_tv - state: unavailable - sequence: - - service: androidtv.adb_command - continue_on_error: true - data: - entity_id: media_player.keller_tv - command: "pm clear com.tcl.videoplayer" - - service: androidtv.adb_command - continue_on_error: true - data: - entity_id: media_player.keller_tv - command: "am start -a android.intent.action.VIEW -d /sdcard/bitte_gib_mir_die_shisha.mp4 -t video/mp4" - - service: notify.keller_tv - continue_on_error: true - data: - message: "Die Kohle sollte fertig sein!" - -- id: check_if_coal_lighter_has_been_forgotten - alias: Check if coal_lighter has been forgotten - initial_state: true - trigger: - - platform: state - entity_id: switch.kohleanzunder - to: "on" - for: - minutes: 25 - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_washing_machine_is_currently_active.attributes.last_triggered) | int > 1260 }}" - - condition: state - entity_id: switch.kohleanzunder - state: "on" - action: - - choose: - # IF 5 friends are there - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: state - entity_id: person.fabian - state: "JUZ" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_5friends - message: "Der Kohleanzunder wurde vor 25 Minuten eingeschaltet aber die Automationen nicht gestartet. Ggf. Fehler und die Kohle ist fertig." - # ELSEIF only K&A are there - - conditions: - - condition: or - conditions: - - condition: and - conditions: - - condition: and - conditions: - - condition: state - entity_id: person.kai - state: home - - condition: state - entity_id: person.adri - state: home - - condition: not - conditions: - - condition: state - entity_id: person.flo - state: home - - condition: state - entity_id: person.maxi - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - - condition: state - entity_id: person.kai - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_afk - message: "Der Kohleanzunder wurde vor 25 Minuten eingeschaltet aber die Automationen nicht gestartet. Ggf. Fehler und die Kohle ist fertig." - - conditions: - - condition: or - conditions: - - condition: state - entity_id: person.adri - state: home - - condition: and - conditions: - - condition: state - entity_id: person.fabian - state: "Kai-Adri" - - condition: state - entity_id: person.adri - state: "Kai-Adri" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_adrian - message: "Der Kohleanzunder wurde vor 25 Minuten eingeschaltet aber die Automationen nicht gestartet. Ggf. Fehler und die Kohle ist fertig." - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Der Kohleanzunder wurde vor 25 Minuten eingeschaltet aber die Automationen nicht gestartet. Ggf. Fehler und die Kohle ist fertig." - # ELSE only notify fabian - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Der Kohleanzunder wurde vor 25 Minuten eingeschaltet aber die Automationen nicht gestartet. Ggf. Fehler und die Kohle ist fertig." - -- id: check_if_washing_machine_has_been_forgotten - alias: Check if washing machine has been forgotten - initial_state: true - trigger: - - platform: state - entity_id: switch.waschmaschine - to: "on" - for: - hours: 6 - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_washing_machine_is_currently_active.attributes.last_triggered) | int > 21650 }}" - - condition: state - entity_id: switch.waschmaschine - state: "on" - action: - - service: notify.telegram_samuel - data: - message: "Die Waschmaschine wurde vor 6 Stunden eingeschaltet aber die Automation nicht gestartet. Fehler und Wäsche wurde vergessen?" - - service: notify.telegram_fabian - data: - message: "Die Waschmaschine wurde vor 6 Stunden eingeschaltet aber die Automation nicht gestartet. Fehler und Wäsche wurde vergessen?" - -- id: detect_if_washing_machine_is_currently_active - alias: Detect if Washing machine is currently active - mode: single - trigger: - - platform: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 22 - below: 469 - for: - seconds: 40 - - platform: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 1800 - for: - seconds: 5 - - platform: state - entity_id: switch.waschmaschine - to: "on" - for: - minutes: 8 - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_washing_machine_is_currently_active.attributes.last_triggered) | int > 3600 }}" - - condition: state - entity_id: switch.waschmaschine - state: "on" - - condition: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 22 - action: - - choose: - - conditions: - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 89000 - - condition: state - entity_id: person.fabian - state: "home" - sequence: - - service: notify.telegram_fabian - data: - message: "Die Waschmaschine wurde gestartet. Wähle das Waschprogramm aus um eine Zeit zu erhalten, wann die Waschmaschine fertig ist:" - data: - inline_keyboard: - - "30° PL:/washerstart30, 40° PL:/washerstart40, 40° Koch-Bunt:/washerstart40kb, 20° Fein:/washerstart20fw, 60° Koch-Bunt:/washerstart60kb" - - choose: - - conditions: - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 55000 - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: notify.telegram_samuel - data: - message: "Die Waschmaschine wurde gestartet. Wähle das Waschprogramm aus um eine Zeit zu erhalten, wann die Waschmaschine fertig ist:" - data: - inline_keyboard: - - "30° PL:/washerstart30, 40° PL:/washerstart40, 40° Koch-Bunt:/washerstart40kb, 20° Fein:/washerstart20fw, 60° Koch-Bunt:/washerstart60kb" - - service: input_select.select_option - data: - entity_id: input_select.washing_machine_status - option: Running - - service: automation.turn_on - data: - entity_id: - - automation.set_washing_machine_active_when_power_detected - - automation.set_washing_machine_clean_when_power_drops - - service: automation.turn_off - data: - entity_id: - - automation.detect_if_coal_lighter_is_currently_active - - automation.detect_if_washing_machine_is_currently_active - -- id: set_washing_machine_active_when_power_detected - alias: Set washing machine active when power detected - trigger: - - platform: numeric_state - entity_id: sensor.keller_steckdose_energy_power - above: 22 - condition: - condition: or - conditions: - - condition: state - entity_id: sensor.washing_machine_state - state: Idle - - condition: state - entity_id: sensor.washing_machine_state - state: Clean - - condition: state - entity_id: sensor.washing_machine_state - state: Finishing - # - condition: template - # value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_coal_lighter_is_currently_active.attributes.last_triggered) | int > 50 }}" - action: - - service: input_select.select_option - data: - entity_id: input_select.washing_machine_status - option: Running - -# When the power drops, move the state of the washing machine to Clean -- id: set_washing_machine_clean_when_power_drops - alias: Set washing machine clean when power drops - trigger: - - platform: numeric_state - entity_id: sensor.keller_steckdose_energy_power - below: 6 - for: - minutes: 3 - condition: - condition: and - conditions: - - condition: state - entity_id: input_select.washing_machine_status - state: Running - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.detect_if_coal_lighter_is_currently_active.attributes.last_triggered) | int > 900 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.set_washing_machine_active_when_power_detected.attributes.last_triggered) | int > 1680 }}" - action: - - service: input_select.select_option - data: - entity_id: input_select.washing_machine_status - option: Clean - - choose: - - conditions: - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 35000 - - condition: state - entity_id: person.fabian - state: "home" - sequence: - - service: notify.telegram_fabian - data: - message: "Die Waschmaschine ist fertig. Bitte ausräumen." - data: - inline_keyboard: - - "Erledigt:/telegramwasherdone" - - choose: - - conditions: - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 35000 - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: notify.telegram_samuel - data: - message: "Die Waschmaschine ist fertig. Bitte ausräumen." - data: - inline_keyboard: - - "Erledigt:/telegramwasherdone" - - service: automation.turn_on - data: - entity_id: - - automation.detect_if_washing_machine_is_currently_active - - automation.detect_if_coal_lighter_is_currently_active - - service: switch.turn_off - data: - entity_id: switch.waschmaschine - - service: automation.turn_off - data: - entity_id: automation.set_washing_machine_clean_when_power_drops - - choose: - - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_uhr - state: "playing" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.wohnzimmer_uhr - message: "Die Waschmaschine ist fertig." - - choose: - - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: not - conditions: - - condition: state - entity_id: media_player.kuche_lautsprecher - state: "playing" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.kuche_lautsprecher - message: "Die Waschmaschine ist fertig." - - choose: - - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: not - conditions: - - condition: state - entity_id: media_player.fabians_lautsprecher - state: "playing" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.fabians_lautsprecher - message: "Die Waschmaschine ist fertig." - -- id: set_washing_machine_idle_after_timeout - alias: Set washing machine idle after timeout - trigger: - - platform: state - entity_id: input_select.washing_machine_status - to: Clean - for: - minutes: 120 - action: - - service: input_select.select_option - data: - entity_id: input_select.washing_machine_status - option: Idle - -- id: resume_music_in_keller_after_shisha_video - alias: Resume music in keller after shisha video - initial_state: true - trigger: - - platform: state - entity_id: media_player.keller_tv - attribute: app_id - from: com.tcl.videoplayer - action: - - service: media_player.media_play - data: - entity_id: media_player.keller_tv - -- id: remind_for_finished_rice_cooker - alias: Remind for finished rice cooker - initial_state: true - trigger: - - platform: numeric_state - entity_id: sensor.xiaomi_miio_cooker_remaining - below: 5 - condition: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_finished_rice_cooker.attributes.last_triggered) | int > 1200 }}" - action: - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "home" - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: notify.telegram_samuel - data_template: - message: "Der Reiskocher ist in {{ states.sensor.xiaomi_miio_cooker_remaining.state }} Minuten fertig." - - service: notify.telegram_fabian - data_template: - message: "Der Reiskocher ist in {{ states.sensor.xiaomi_miio_cooker_remaining.state }} Minuten fertig." - - choose: - - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_uhr - state: "playing" - - condition: or - conditions: - - condition: state - entity_id: person.fabian - state: "home" - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: - - media_player.wohnzimmer_uhr - - media_player.kuche_lautsprecher - message: "Der Reiskocher ist in {{ states.sensor.xiaomi_miio_cooker_remaining.state }} Minuten fertig." - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: schnelles Kochen - -- id: turn_on_rice_cooker_when_timer_started - alias: "Turn on rice cooker when timer started" - initial_state: true - trigger: - - platform: template - value_template: "{{ as_timestamp(now()) | round(-1) == (states.input_datetime.cooker_start_time.attributes.timestamp) | round(-1) }}" - action: - - service: switch.turn_on - data: - entity_id: switch.kuchengerate - - delay: 00:01:00 - - service: switch.turn_on - data: - entity_id: switch.xiaomi_miio_cooker - - service: notify.telegram_samuel - data_template: - message: "Der Reiskocher wurde automatisch angeschaltet im Programm {{ states.input_select.rice_cooker_program.state }}." - - service: notify.telegram_fabian - data_template: - message: "Der Reiskocher wurde automatisch angeschaltet im Programm {{ states.input_select.rice_cooker_program.state }}." - -- id: set_rice_cooker_menu_state - alias: "Set ricecooker menu state" - initial_state: true - trigger: - - platform: state - entity_id: sensor.xiaomi_miio_cooker_menu - not_from: - - "unavailable" - - "unknown" - - "" - - "Unknown" - action: - - choose: - - conditions: - - condition: state - entity_id: sensor.xiaomi_miio_cooker_menu - state: "Fine Rice" - sequence: - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: "Kochen 1h" - - choose: - - conditions: - - condition: state - entity_id: sensor.xiaomi_miio_cooker_menu - state: "Keep warm" - sequence: - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: "Wärmen" - - choose: - - conditions: - - condition: state - entity_id: sensor.xiaomi_miio_cooker_menu - state: "Quick Rice" - sequence: - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: "schnelles Kochen" - - choose: - - conditions: - - condition: state - entity_id: sensor.xiaomi_miio_cooker_menu - state: "Congee" - sequence: - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: "Porridge" - - choose: - - conditions: - - condition: state - entity_id: sensor.xiaomi_miio_cooker_menu - state: "Unknown menu" - sequence: - - service: input_select.select_option - data: - entity_id: input_select.rice_cooker_program - option: "Sonstiges" - -- id: remind_for_finished_airfryer - alias: Remind for finished airfryer - initial_state: true - trigger: - - platform: numeric_state - entity_id: sensor.xiaomi_airfryer_remaining - below: 5 - condition: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_finished_airfryer.attributes.last_triggered) | int > 1200 }}" - action: - - choose: - - conditions: - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "home" - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: notify.telegram_samuel - data_template: - message: "Der Airfryer ist in {{ states.sensor.xiaomi_airfryer_remaining.state }} Minuten fertig." - - service: notify.telegram_fabian - data_template: - message: "Der Airfryer ist in {{ states.sensor.xiaomi_airfryer_remaining.state }} Minuten fertig." - - choose: - - conditions: - - condition: state - entity_id: input_boolean.leiser_modus - state: "off" - - condition: not - conditions: - - condition: state - entity_id: media_player.wohnzimmer_uhr - state: "playing" - - condition: or - conditions: - - condition: state - entity_id: person.fabian - state: "home" - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: - - media_player.wohnzimmer_uhr - - media_player.kuche_lautsprecher - message: "Der Airfryer ist in {{ states.sensor.xiaomi_airfryer_remaining.state }} Minuten fertig." - -- id: kitchen_timer_reminder - alias: Kitchen Timer Reminder - initial_state: true - trigger: - - platform: numeric_state - entity_id: sensor.kuche_lautsprecher_timers - below: 5 - condition: - condition: or - conditions: - - condition: state - entity_id: switch.fernseher - state: "on" - - condition: state - entity_id: switch.fernseher_keller - state: "on" - action: - - choose: - - conditions: - - condition: state - entity_id: person.fabian - state: home - sequence: - - service: notify.telegram_fabian - data: - message: "Der Timer in der Küche ist in {{ states.sensor.kuche_lautsprecher_timers.state }} Minuten fertig." - - choose: - - conditions: - - condition: state - entity_id: person.samuel - state: home - sequence: - - service: notify.telegram_samuel - data: - message: "Der Timer in der Küche ist in {{ states.sensor.kuche_lautsprecher_timers.state }} Minuten fertig." - - choose: - - conditions: - - condition: state - entity_id: switch.fernseher - state: "on" - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.wohnzimmer_uhr - message: "Der Timer in der Küche ist in {{ states.sensor.kuche_lautsprecher_timers.state }} Minuten fertig." - -- id: turn_off_kitchen_devices_after_x_minutes - alias: "Turn off kitchen devices after x minutes" - initial_state: true - trigger: - - platform: state - entity_id: switch.kuchengerate - to: "on" - for: - minutes: 20 - - platform: state - entity_id: switch.kuchengerate - from: "off" - to: "on" - for: - minutes: 25 - - platform: state - entity_id: switch.xiaomi_miio_cooker - from: "on" - to: "off" - for: - minutes: 40 - condition: - condition: and - conditions: - - condition: state - entity_id: switch.xiaomi_miio_cooker - state: "off" - - condition: state - entity_id: switch.kuchengerate - state: "on" - action: - - service: switch.turn_off - data: - entity_id: switch.kuchengerate - -# - id: turn_on_airplane_mode_fabi -# alias: 'Turn on Airplane Mode Fabi' -# initial_state: true -# trigger: -# - platform: time -# at: '23:30:00' -# - platform: time -# at: '03:30:00' -# condition: -# condition: and -# conditions: -# - condition: time -# weekday: -# - mon -# - tue -# - wed -# - thu -# - sun -# - condition: state -# entity_id: device_tracker.pixel_8_pro -# state: home -# - condition: template -# value_template: > -# {% set domain = 'light' %} -# {% set state = 'off' %} -# {{ states[domain] | count == states[domain] | selectattr('state','eq', state) | list | count }} -# action: -# - service: notify.mobile_app_pixel_8_pro -# data_template: -# title: "Flugmodus" -# message: "Flugmodus wurde vergessen und wird nun automatisch aktiviert!" -# data: -# data: -# tag: 'notification-about-sensor' - -- id: check_termostat_sleepingroom - alias: "check thermostats" - initial_state: true - trigger: - platform: time - at: "19:40:00" - action: - - service: switch.turn_on - data: - entity_id: switch.adaptive_lighting_sleeping_room - - choose: - - conditions: - - condition: state - entity_id: "input_boolean.thermostate_aus" - state: "off" - - condition: not - conditions: - - condition: state - entity_id: climate.fabian_s_zimmer - state: "auto" - - condition: state - entity_id: device_tracker.fabian_pc - state: "home" - sequence: - # - service: notify.telegram_fabian - # data: - # message: "Das Thermostat in Fabians Zimmer war noch auf {{ states.climate.fabian_s_zimmer.attributes.temperature }} °C eingestellt und wurde nun automatisch eingeschaltet." - - service: climate.set_hvac_mode - data: - entity_id: climate.fabian_s_zimmer - hvac_mode: auto - -- id: pill_reminder - alias: "Pill Reminder" - trigger: - platform: time - at: "19:50:00" - action: - - choose: - - conditions: - - condition: numeric_state - entity_id: counter.pille - below: "29" - sequence: - - service: counter.increment - target: - entity_id: counter.pille - - choose: - - conditions: - - condition: numeric_state - entity_id: counter.pille - below: 30 - above: 28 - sequence: - - service: counter.reset - target: - entity_id: counter.pille - - choose: - - conditions: - - condition: numeric_state - entity_id: counter.pille - below: "21" - sequence: - - service: notify.telegram_fabian - data_template: - message: "Pille nehmen nicht vergessen! Heute ist Tag {{ states.counter.pille.state }} von {{ (states.counter.pille.attributes.maximum) - 1 }}." - data: - inline_keyboard: - - "Erledigt:/pilldone, Erinnern in 1h:/pill1h" - - choose: - - conditions: - - condition: numeric_state - entity_id: counter.pille - below: 22 - above: 20 - sequence: - - service: notify.telegram_fabian - data: - message: "Pille nehmen nicht vergessen! Heute ist der letze Tag, an dem du die Pille nehmen musst. Ab morgen kommen für 7 Tage keine Erinnerungen." - data: - inline_keyboard: - - "Erledigt:/pilldone, Erinnern in 1h:/pill1h, Durchnehmen:/pillreset" - - service: notify.telegram_fabian - data: - message: "Heute ist der letze Tag, an dem samuel die Pille nimmt für 7 Tage." - -- id: samuel_forgot_pill - alias: "samuel forgot pill" - initial_state: false - trigger: - - platform: time - at: "23:00:00" - condition: - condition: and - conditions: - - condition: time - weekday: - - mon - - tue - - wed - - thu - - sun - - condition: not - conditions: - - condition: state - entity_id: automation.telegram_pill_marked_done - attribute: last_triggered - state: none - - condition: numeric_state - entity_id: counter.pille - below: "22" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_pill_marked_done.attributes.last_triggered) | int > 10800 }}" - action: - - choose: - - conditions: - - condition: state - entity_id: person.samuel - state: home - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.fabians_lautsprecher - message: "Samuel, du hast die Pille vergessen" - - service: notify.telegram_samuel - data: - message: "Du hast die Pille vergessen!" - - service: notify.mobile_app_samuel_iphone - data: - message: "Du hast die Pille vergessen!" - data: - push: - sound: - name: "default" - critical: 1 - volume: 1.0 - -- id: samuel_forgot_pill_weekend - alias: "samuel forgot pill weekend" - initial_state: false - trigger: - - platform: time - at: "00:00:00" - condition: - condition: and - conditions: - - condition: time - weekday: - - fri - - sat - - condition: not - conditions: - - condition: state - entity_id: automation.telegram_pill_marked_done - attribute: last_triggered - state: none - - condition: numeric_state - entity_id: counter.pille - below: 22 - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_pill_marked_done.attributes.last_triggered) | int > 14760 }}" - action: - - choose: - - conditions: - - condition: state - entity_id: person.samuel - state: home - sequence: - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.fabians_lautsprecher - message: "Samuel, du hast die Pille vergessen" - - service: notify.telegram_samuel - data: - message: "Du hast die Pille vergessen!" - - service: notify.mobile_app_samuel_iphone - data: - message: "Du hast die Pille vergessen!" - data: - push: - sound: - name: "default" - critical: 1 - volume: 1.0 - -- id: turn_off_everything_in_keller_if_tv_is_unavailable - alias: Turn off everything in keller if tv is unavailable - initial_state: true - trigger: - platform: state - entity_id: media_player.keller_tv - to: "unavailable" - for: - minutes: 10 - condition: - condition: and - conditions: - - condition: state - entity_id: switch.fernseher_keller - state: "off" - - condition: state - entity_id: switch.strom_keller - state: "off" - action: - #- service: switch.turn_off - # data: - # entity_id: switch.kuhlschrank - - service: switch.turn_off - data: - entity_id: switch.keller_usb_ports - -- id: remind_for_light_keller - alias: Remind for light keller - initial_state: true - trigger: - platform: state - entity_id: media_player.keller_tv - from: "unavailable" - condition: - condition: and - conditions: - - condition: time - after: "17:00:00" - before: "00:00:00" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_light_keller.attributes.last_triggered) | int > 12000 }}" - - condition: or - conditions: - - condition: state - entity_id: group.fabian_s_zimmer - state: "on" - - condition: state - entity_id: group.wohnzimmer - state: "on" - action: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: > - Es ist noch Licht oder Strom an im - {% if (is_state("group.fabian_s_zimmer", "on")) -%} - fabian_s_zimmer - {% endif %} - {% if (is_state("group.wohnzimmer", "on")) -%} - Wohnzimmer - {% endif %} - {% if (is_state("group.samuel_s_zimmer", "on")) -%} - & Samuels Zimmer - {% endif %} - . Ausschalten? - -- id: set_climate_living_room_if_in_keller - alias: Set climate living room if in keller - initial_state: true - trigger: - platform: state - entity_id: media_player.keller_tv - from: "unavailable" - condition: - condition: and - conditions: - - condition: time - after: "17:00:00" - before: "00:00:00" - action: - - service: climate.turn_off - data: - entity_id: climate.wohnzimmer - -- id: set_climate_living_room_if_samuel_and_fabi_at_pc - alias: Set climate living room if samuel and fabi at PC - initial_state: true - trigger: - - platform: state - entity_id: device_tracker.fabian_pc - to: "home" - - platform: state - entity_id: device_tracker.md3f9bmc - to: "home" - - platform: state - entity_id: device_tracker.c_pf38fwqx_pari - to: "home" - - platform: state - entity_id: device_tracker.md3f9bmc - to: "home" - condition: - condition: and - conditions: - - condition: state - entity_id: "input_boolean.thermostate_aus" - state: "off" - - condition: state - entity_id: input_boolean.gast_modus - state: "off" - - condition: or - conditions: - - condition: state - entity_id: device_tracker.fabian_pc - state: "home" - - condition: state - entity_id: device_tracker.c_pf38fwqx_pari - state: "home" - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "home" - - condition: or - conditions: - - condition: state - entity_id: "switch.schreibtisch_samuel" - state: "on" - - condition: not - conditions: - - condition: state - entity_id: person.samuel - state: "home" - action: - - service: climate.set_temperature - data: - entity_id: climate.wohnzimmer - temperature: 16 - hvac_mode: heat - - service: automation.turn_on - data: - entity_id: automation.set_climate_living_room_if_samuel_and_fabi_not_at_pc - -- id: set_climate_living_room_if_samuel_and_fabi_not_at_pc - alias: Set climate living room if samuel and fabi not at PC - initial_state: false - trigger: - - platform: state - entity_id: device_tracker.fabian_pc - to: "not_home" - - platform: state - entity_id: device_tracker.md3f9bmc - to: "not_home" - - platform: state - entity_id: device_tracker.c_pf38fwqx_pari - to: "not_home" - - platform: state - entity_id: switch.schreibtisch_samuel - to: "off" - condition: - - condition: state - entity_id: "input_boolean.thermostate_aus" - state: "off" - action: - - service: climate.set_hvac_mode - data: - entity_id: climate.wohnzimmer - hvac_mode: auto - - service: automation.turn_off - data: - entity_id: automation.set_climate_living_room_if_samuel_and_fabi_not_at_pc - -- id: remind_for_guest_mode - alias: remind for guest mode - initial_state: false - trigger: - platform: state - entity_id: media_player.keller_tv - to: "unavailable" - for: - minutes: 5 - condition: - condition: and - conditions: - - condition: time - after: "23:00:00" - before: "06:00:00" - - condition: state - entity_id: "input_boolean.gast_modus" - state: "off" - - condition: not - conditions: - - condition: state - entity_id: calendar.fabianseitz98_gmail_com - attribute: message - state: "Gruppentreffen" - action: - - service: input_boolean.turn_on - data: - entity_id: input_boolean.gast_modus - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - message: "Übernachtet heute ein Gast? Gast Modus wurde automatisch eingeschaltet." - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - message: "Übernachtet heute ein Gast? Gast Modus wurde automatisch eingeschaltet." - -- id: set_climate_living_room_if_keller_left - alias: Set climate living room if keller left - initial_state: true - trigger: - platform: state - entity_id: media_player.keller_tv - to: "unavailable" - for: - minutes: 10 - condition: - condition: and - conditions: - - condition: time - after: "17:00:00" - before: "00:00:00" - - condition: state - entity_id: "input_boolean.thermostate_aus" - state: "off" - action: - - service: climate.set_hvac_mode - data: - entity_id: climate.wohnzimmer - hvac_mode: auto - -- id: notify_on_sbahn_delay_home_work - alias: "Notify Fabi on sbahn delay Home -> Work" - initial_state: true - trigger: - - platform: numeric_state - entity_id: "sensor.zorneding_to_leuchtenbergring" - attribute: delay - above: 5 - condition: - condition: and - conditions: - - condition: or - conditions: - - condition: state - entity_id: device_tracker.pixel_8_pro - state: home - - condition: state - entity_id: device_tracker.redmi_note_10_pro - state: home - - condition: time - after: "06:30:00" - before: "07:10:00" - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - action: - - choose: - - conditions: - - condition: state - entity_id: device_tracker.pixel_8_pro - state: home - sequence: - - service: notify.telegram_fabian - data: - title: "Sbahn um {{ states.sensor.zorneding_to_leuchtenbergring.attributes.departure }} hat +{{ states.sensor.zorneding_to_leuchtenbergring.attributes.delay }} min Verspätung." - message: "Nächste Sbahn: {{ states.sensor.zorneding_to_leuchtenbergring.attributes.next_1 }} Uhr" - -- id: notify_fabian_on_sbahn_delay_work_home - alias: "Notify on Sbahn delay Work -> Home" - initial_state: true - trigger: - - platform: numeric_state - entity_id: "sensor.starnberg_nord_to_zorneding" - attribute: delay - above: 3 - condition: - condition: and - conditions: - - condition: time - after: "16:45:00" - before: "17:30:00" - weekday: - - mon - - tue - - wed - - thu - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 89000 - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - above: 20000 - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: home - action: - - service: notify.telegram_fabian - data: - title: "Sbahn um {{ states.sensor.starnberg_nord_to_zorneding.attributes.departure }} Uhr nach Hause +{{ states.sensor.starnberg_nord_to_zorneding.attributes.delay }} min." - message: "Nächste Sbahn: {{ states.sensor.starnberg_nord_to_zorneding.attributes.next_1 }} Uhr" - -- id: notify_on_sbahn_delay_work_samuel_home - alias: "Notify on Sbahn delay Work samuel -> Home" - initial_state: false - trigger: - - platform: state - entity_id: person.samuel - from: "Arbeit samuel" - to: "not_home" - condition: - - condition: numeric_state - entity_id: "sensor.leuchtenbergring_to_zorneding" - attribute: delay - above: 3 - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - action: - - service: notify.telegram_samuel - data: - message: "Sbahn in Leuchtenbergring um {{ states.sensor.leuchtenbergring_to_zorneding.attributes.departure }} Uhr hat voraussichtlich {{ states.sensor.leuchtenbergring_to_zorneding.attributes.delay }} min Verspätung." - -- id: notify_samuel_fabian_on_way_home - alias: "Notify samuel Fabian on way home" - initial_state: false - trigger: - - platform: state - entity_id: sensor.smart_life_fabian_direction_of_travel - to: "towards" - for: - minutes: 6 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - above: 3000 - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 30000 - - condition: state - entity_id: person.samuel - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_longer_distance.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_long_distance.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_from_sta.attributes.last_triggered) | int > 3700 }}" - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "Arbeit Fabi" - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_fabian_distance.state }} km entfernt von zu Hause." - -- id: notify_samuel_fabian_on_way_home_longer_distance - alias: "Notify samuel Fabian on way home longer distance" - initial_state: false - trigger: - - platform: state - entity_id: sensor.smart_life_fabian_direction_of_travel - to: "towards" - for: - minutes: 22 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - above: 29000 - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 90000 - - condition: state - entity_id: person.samuel - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_longer_distance.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_long_distance.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_from_sta.attributes.last_triggered) | int > 4700 }}" - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "Arbeit Fabi" - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_fabian_distance.state }} km entfernt von zu Hause." - -- id: notify_samuel_fabian_on_way_home_long_distance - alias: "Notify samuel Fabian on way home long distance" - initial_state: false - trigger: - - platform: state - entity_id: sensor.smart_life_fabian_direction_of_travel - to: "towards" - for: - minutes: 50 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - above: 89000 - - condition: state - entity_id: person.samuel - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_longer_distance.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_long_distance.attributes.last_triggered) | int > 4600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_from_sta.attributes.last_triggered) | int > 4600 }}" - - condition: not - conditions: - - condition: state - entity_id: person.fabian - state: "Arbeit Fabi" - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_fabian_distance.state }} km entfernt von zu Hause." - -- id: notify_fabian_samuel_on_way_home - alias: "Notify Fabian samuel on way home" - initial_state: true - trigger: - - platform: state - entity_id: sensor.smart_life_fabian_direction_of_travel - to: "towards" - for: - minutes: 8 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - above: 3000 - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 30000 - - condition: state - entity_id: person.fabian - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_longer_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_long_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_work.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_berufsschule.attributes.last_triggered) | int > 3600 }}" - - condition: not - conditions: - - condition: state - entity_id: person.samuel - state: "arbeit_samuel" - - condition: state - entity_id: person.samuel - state: "Arbeit samuel" - - condition: state - entity_id: person.samuel - state: "Berufsschule" - action: - - service: notify.telegram_fabian - data: - message: "samuel ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_samuel_distance.state }} km entfernt von zu Hause." - -- id: notify_fabian_samuel_on_way_home_longer_distance - alias: "Notify Fabian samuel on way home longer distance" - initial_state: true - trigger: - - platform: state - entity_id: sensor.smart_life_samuel_direction_of_travel - to: "towards" - for: - minutes: 15 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - above: 29000 - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 90000 - - condition: state - entity_id: person.fabian - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_longer_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_long_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_work.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_berufsschule.attributes.last_triggered) | int > 3600 }}" - - condition: not - conditions: - - condition: state - entity_id: person.samuel - state: "arbeit_samuel" - - condition: state - entity_id: person.samuel - state: "Berufsschule" - action: - - service: notify.telegram_fabian - data: - message: "samuel ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_samuel_distance.state }} km entfernt von zu Hause." - -- id: notify_fabian_samuel_on_way_home_long_distance - alias: "Notify Fabian samuel on way home long distance" - initial_state: true - trigger: - - platform: state - entity_id: sensor.smart_life_samuel_direction_of_travel - to: "towards" - for: - minutes: 30 - condition: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - above: 89000 - - condition: state - entity_id: person.fabian - state: home - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_longer_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_long_distance.attributes.last_triggered) | int > 1800 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_work.attributes.last_triggered) | int > 3600 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_fabian_samuel_on_way_home_from_berufsschule.attributes.last_triggered) | int > 3600 }}" - - condition: not - conditions: - - condition: state - entity_id: person.samuel - state: "arbeit_samuel" - - condition: state - entity_id: person.samuel - state: "Berufsschule" - action: - - service: notify.telegram_fabian - data: - message: "samuel ist auf dem Weg nach Hause und ist noch {{ states.sensor.smart_life_samuel_distance.state }} km entfernt von zu Hause." - -- id: notify_samuel_fabian_on_way_home_from_sta - alias: "Notify samuel Fabian on way home from STA" - initial_state: false - trigger: - - platform: state - entity_id: person.fabian - from: "Arbeit Fabi" - to: "not_home" - condition: - - condition: time - after: "14:00:00" - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_from_sta.attributes.last_triggered) | int > 3600 }}" - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 35000 - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - above: 10000 - action: - - parallel: - - choose: - - conditions: - - condition: state - entity_id: person.samuel - state: home - - condition: state - entity_id: - - input_boolean.leiser_modus - - input_boolean.gast_modus - state: "off" - sequence: - - choose: - - conditions: - - condition: state - entity_id: media_player.kuche_lautsprecher - state: "off" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.kuche_lautsprecher - - delay: 00:00:02 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.kuche_lautsprecher - message: "Fabian ist auf dem Weg nach Hause und kommt voraussichtlich um {{ states.sensor.starnberg_nord_to_zorneding.attributes.arrival }} Uhr mit {{ states.sensor.starnberg_nord_to_zorneding.attributes.delay }} min Verspätung in Zorneding an." - - delay: 00:00:08 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.kuche_lautsprecher - - choose: - - conditions: - - condition: state - entity_id: media_player.samuels_lautsprecher - state: "off" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.samuels_lautsprecher - - delay: 00:00:02 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.samuels_lautsprecher - message: "Fabian ist auf dem Weg nach Hause und kommt voraussichtlich um {{ states.sensor.starnberg_nord_to_zorneding.attributes.arrival }} Uhr mit {{ states.sensor.starnberg_nord_to_zorneding.attributes.delay }} min Verspätung in Zorneding an." - - delay: 00:00:08 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.samuels_lautsprecher - - choose: - - conditions: - - condition: state - entity_id: media_player.wohnzimmer_uhr - state: "off" - sequence: - - service: media_player.volume_set - data_template: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) }} - entity_id: media_player.wohnzimmer_uhr - - delay: 00:00:02 - - service: tts.speak - continue_on_error: true - target: - entity_id: tts.google_de_de - data_template: - media_player_entity_id: media_player.wohnzimmer_uhr - message: "Fabian ist auf dem Weg nach Hause und kommt voraussichtlich um {{ states.sensor.starnberg_nord_to_zorneding.attributes.arrival }} Uhr mit {{ states.sensor.starnberg_nord_to_zorneding.attributes.delay }} min Verspätung in Zorneding an." - - delay: 00:00:08 - - service: media_player.volume_set - data: - volume_level: > - {{ ((states.input_number.lautstarke_ansagen.state) | float * 0.1) | round(1) | float - 0.2 }} - entity_id: media_player.wohnzimmer_uhr - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause von Starnberg und kommt voraussichtlich um {{ states.sensor.starnberg_nord_to_zorneding.attributes.arrival }} Uhr mit {{ states.sensor.starnberg_nord_to_zorneding.attributes.delay }} min Verspätung in Zorneding an." - -- id: notify_samuel_fabian_on_way_home_from_gil - alias: "Notify samuel Fabian on way home from GIL" - initial_state: false - trigger: - - platform: state - entity_id: person.fabian - from: "Arbeit Fabi GIL" - to: "not_home" - condition: - - condition: time - after: "14:00:00" - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.notify_samuel_fabian_on_way_home_from_gil.attributes.last_triggered) | int > 3600 }}" - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 35000 - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause von Gilching und kommt voraussichtlich in 1,25 Stunden nach Hause." - -- id: notify_samuel_fabian_on_way_home_from_muc - alias: "Notify samuel Fabian on way home from MUC" - initial_state: false - trigger: - - platform: state - entity_id: person.fabian - from: "Arbeit Fabi MUC" - to: "not_home" - condition: - - condition: time - after: "14:00:00" - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 35000 - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause von Gräfelfing und kommt voraussichtlich in einer Stunde in Zorneding an." - -- id: notify_samuel_fabian_on_way_home_from_whm - alias: "Notify samuel Fabian on way home from WHM" - initial_state: false - trigger: - - platform: state - entity_id: person.fabian - from: "Arbeit Fabi WHM" - to: "not_home" - condition: - - condition: time - after: "14:00:00" - - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 35000 - action: - - service: notify.telegram_samuel - data: - message: "Fabian ist auf dem Weg nach Hause von Weilheim. Da er mit dem Auto fährt ist keine Zeitangabe möglich. Voraussichtlich daheim in ca. 1,5 Stunden." - -- id: telegram_send_daily_weather_forecast_fabian - alias: "Telegram send daily weather forecast fabian" - initial_state: true - trigger: - - platform: state - entity_id: device_tracker.pixel_8_pro - from: "not_home" - to: "home" - condition: - - condition: time - before: "10:00:00" - - condition: time - after: "05:00:00" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_send_daily_weather_forecast_fabian.attributes.last_triggered) | int > 36000 }}" - action: - #- service: weather.get_forecasts - # data: - # type: daily - # target: - # entity_id: sensor.weather_ebersberg_daily - # response_variable: weather_forecast - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - disable_notification: true - #{{ states.sensor.sensor.ebersberg_temperature_2.attributes.templow }} °C {{ '\u21F5' }} {{ weather_forecast.forecast.0.temperature }} °C - message: > - Wettervorhersage für heute {{ states.weather.ebersberg_ebersberg.state }} bei {{ states.weather.ebersberg_ebersberg.attributes.temperature }} °C - *Momentan {{ states.sensor.weather_ebersberg_hourly.attributes.forecast[0].temperature }} °C* - - - Niederschlag: {{ states.sensor.ebersberg_precipitation_2.state }} mm/h, Wahrscheinlichkeit: {{ states.sensor.ebersberg_precipitation_probability_2.state }} %. - - - {% if states.person.samuel.state != "home" %}Samuel ist nicht daheim.{% endif %} - -- id: remind_for_dnd - alias: "remind for dnd" - initial_state: true - trigger: - - platform: template - value_template: "{{ as_timestamp(now()) | round(-1) == (as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) - 198000) | round(-1) }}" - - platform: template - value_template: "{{ as_timestamp(now()) | round(-1) == (as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) - 111600) | round(-1) }}" - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_dnd.attributes.last_triggered) | int > 518400 }}" - - condition: template - value_template: "{{ ((as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) - as_timestamp(now())) < 199000) and ((as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) - as_timestamp(now())) > 0) }}" - - condition: state - entity_id: calendar.votgaming_kalender - attribute: message - state: "Dungeons & Dragons Spieleabend" - action: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_spieletreff - disable_notification: true - message: > - Erinnerung: Am {%- set date = as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %}{% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ab {{ as_timestamp(states.calendar.votgaming_kalender.attributes.start_time) | timestamp_custom('%H:%M', true) }} ist {{ states.calendar.votgaming_kalender.attributes.message }}. - -- id: notification_on_new_kadermanager_comment - alias: "Notification on New Kadermanager Comment" - trigger: - - platform: state - entity_id: sensor.kadermanager_zorro - condition: - condition: template - #{% set old_comments = trigger.from_state.attributes.events[0].comments if trigger.from_state.attributes.events else [] %} - #{% set new_comments = trigger.to_state.attributes.events[0].comments if trigger.to_state.attributes.events else [] %} - #{{ new_comments | length > old_comments | length }} - value_template: > - {% set old_comments = trigger.from_state.attributes.events[0].comments if trigger.from_state.attributes.events else [] %} - {% set new_comments = trigger.to_state.attributes.events[0].comments if trigger.to_state.attributes.events else [] %} - {{ new_comments != old_comments }} - action: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "Neuer Kadermanager Kommentar von {{ states.sensor.kadermanager_zorro.attributes.events[0].comments[0].author }}: - - {{ states.sensor.kadermanager_zorro.attributes.events[0].comments[0].text }}" - -- id: notification_on_new_kadermanager_comment_tischabwischer - alias: "Notification on New Kadermanager Comment Tischabwischer" - trigger: - - platform: state - entity_id: sensor.kadermanager_tischabwischer - condition: - condition: template - value_template: > - {% set old_comments = trigger.from_state.attributes.events[0].comments if trigger.from_state.attributes.events else [] %} - {% set new_comments = trigger.to_state.attributes.events[0].comments if trigger.to_state.attributes.events else [] %} - {{ new_comments != old_comments }} - action: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_tischabwischer - body: - text: - "Neuer Kadermanager Kommentar von {{ states.sensor.kadermanager_tischabwischer.attributes.events[0].comments[0].author }}: - - {{ states.sensor.kadermanager_tischabwischer.attributes.events[0].comments[0].text }}" - -- id: remind_for_volleyball_by_kadermanager - alias: "remind for volleyball by kadermanager" - initial_state: true - trigger: - - platform: template - value_template: > - {% set event_date = state_attr('sensor.kadermanager_zorro', 'events')[0]['date'] %} - {% set event_time = state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] %} - {% set event_datetime = strptime(event_date + ' ' + event_time, '%Y-%m-%d %H:%M') %} - {% set reminder_datetime = event_datetime - timedelta(days=2) %} - {% set rounded_reminder_datetime = reminder_datetime.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if reminder_datetime.minute >= 30 else 0) %} - - {% set now = now() %} - {% set rounded_now = (now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if now.minute >= 30 else 0)).replace(tzinfo=None) %} - - {{ rounded_reminder_datetime == rounded_now }} - - platform: template - value_template: > - {% set event_date = state_attr('sensor.kadermanager_zorro', 'events')[0]['date'] %} - {% set event_time = state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] %} - {% set event_datetime = strptime(event_date + ' ' + event_time, '%Y-%m-%d %H:%M') %} - {% set reminder_datetime = event_datetime - timedelta(days=1, hours=12) %} - {% set rounded_reminder_datetime = reminder_datetime.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if reminder_datetime.minute >= 30 else 0) %} - - {% set now = now() %} - {% set rounded_now = (now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if now.minute >= 30 else 0)).replace(tzinfo=None) %} - - {{ rounded_reminder_datetime == rounded_now }} - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball_on_warm_sundays.attributes.last_triggered) | int > 140200 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball_by_kadermanager.attributes.last_triggered) | int > 140200 }}" - action: - - choose: - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] == 'Spiel' }}" - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] == 'Spiel' }}" - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "{%- set zorro_event = state_attr('sensor.kadermanager_zorro', 'events')[0] %} - {%- set tischabwischer_event = state_attr('sensor.kadermanager_tischabwischer', 'events')[0] %} - {%- set zorro_date = strptime(zorro_event['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] %} - {%- set weekday_number = zorro_date.weekday() %} - {%- set weekday_found = weekday[weekday_number] %} - - {{ weekday_found }} ab {{ zorro_event['time'] }} Uhr findet {{ zorro_event['type'] }} {{ zorro_event['title'] }} statt. - Bisherige Kadermanager Zusagen: {{ zorro_event['in_count'] }}. - Bitte im Kadermanager abstimmen nicht vergessen: ({{ zorro_event['link'] }}) - - Außerdem hat die zweite Mannschaft ebenfalls ein Ligaspiel: {{ tischabwischer_event['title'] }}. - Bisherige Kadermanager Zusagen: {{ tischabwischer_event['in_count'] }}. - - {% if 'Heim' in zorro_event['title'] and 'Heim' in tischabwischer_event['title'] %} - Bitte denkt daran, euch gegenseitig einen Schiedsrichter zu stellen, da es sich um zwei Heimspiele handelt, wenn noch nicht geschehen. Bitte meldet euch bei Verfügbarkeit! Danke! - {% elif 'Heim' in zorro_event['title'] %} - Mannschaft 3 hat ein Heimspiel. Bitte stellt sicher, dass ein Schiedsrichter gefunden wird und meldet euch bei Verfügbarkeit! Danke! - {% elif 'Heim' in tischabwischer_event['title'] %} - Mannschaft 2 hat ein Heimspiel. Bitte stellt sicher, dass ein Schiedsrichter gefunden wird und meldet euch bei Verfügbarkeit! Danke! - {% endif %} - - {% if weekday_found == 'Dienstag' %} - Es wird daher KEIN Training stattfinden! - {% endif %}" - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] == 'Spiel' }}" - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_zorro_group - body: - text: - "{%- set date = strptime(state_attr('sensor.kadermanager_zorro', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] }} Uhr findet {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['title'] }} statt. Bisherige Kadermanager Zusagen: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - - - Stimmt bitte fleißig im Kadermanager ab: - - {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }}" - - choose: - - conditions: - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_zorro', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found == 'Dienstag' }} - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "Mannschaft 3 hat am {%- set date = strptime(state_attr('sensor.kadermanager_zorro', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] }} Uhr {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['title'] }}. - - Das Training findet somit bei Bedarf nur mit der 2. Mannschaft statt. {% set event = state_attr('sensor.kadermanager_zorro', 'events')[0] %}{% if 'Heim' in event['title'] %} Wenn es freiwillige als Schiedsrichter gibt, meldet euch bitte!{% endif %}" - - choose: - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['condition'] == 'sunny' }}" - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['condition'] == 'partlycloudy' }}" - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['temperature'] | int >= 20 }}" - - condition: template - value_template: "{{ now().month <= 10 and now().month >= 4 }}" - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] != 'Spiel' }}" - sequence: - - choose: - - conditions: - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_zorro', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found == 'Sonntag' }} - sequence: - - service: telegram_bot.send_poll - data_template: - target: !secret telegram_volleyball - question: - "{%- set date = strptime(state_attr('sensor.kadermanager_zorro', 'events')[0]['date'], '%Y-%m-%d') -%} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{weekday_found}} ist das Wetter gut: {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].condition }} - bei {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].temperature }}° und {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].wind_speed }} km/h Wind. - Ich komme zum Beachvolleyball ab {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] }} Uhr?" - options: - - "Ja" - - "Nein" - - "Vielleicht" - - "Nur zeitweise/verspätet" - is_anonymous: false - allows_multiple_answers: false - disable_notification: true - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: > - {%- set date = strptime(state_attr('sensor.kadermanager_zorro', 'events')[0]['date'], '%Y-%m-%d') -%} - {%- set now_date = strptime(now().strftime('%Y-%m-%d'), '%Y-%m-%d') -%} - {%- set days_until_event = (date - now_date).days -%} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {% if weekday_found == "Sonntag" or weekday_found == "Samstag" %} - {{ weekday_found }} ist das Wetter gut: {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].condition }} - bei {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].temperature }}° und {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].wind_speed }} km/h Wind. - Beachvolleyball ab {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] }} Uhr? - {% else %} - {%- set event_time_str = state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] -%} - {%- set event_date_str = states.calendar.volleyballtraining.attributes.start_time[:10] -%} - {%- set event_datetime_str = event_date_str + ' ' + event_time_str -%} - {%- set event_timestamp = as_timestamp(event_datetime_str) -%} - {{ weekday_found }} ist das Wetter gut: {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].condition }} - bei {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].temperature }}° und {{ states.sensor.weather_ebersberg_daily.attributes.forecast[days_until_event].wind_speed }} km/h Wind. - Beachvolleyball vor dem Training ab {{ (event_timestamp - 2.5 * 3600) | timestamp_custom('%H:%M', true) }} Uhr? - {% endif %} - - Bisherige Kadermanager Zusagen für {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['title'] }}: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - Stimmt bitte fleißig im Kadermanager ab: - - {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }} - default: - - choose: - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] == 'Training' }}" - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_zorro', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found == 'Dienstag' }} - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "{%- set date = strptime(state_attr('sensor.kadermanager_zorro', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] }} Uhr findet {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['title'] }} statt. Bisherige Kadermanager Zusagen: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - - - Stimmt bitte fleißig im Kadermanager ab: - - {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }}" - -- id: remind_for_volleyball_by_kadermanager_2_mannschaft - alias: "remind for volleyball by kadermanager 2. Mannschaft" - initial_state: true - trigger: - - platform: template - value_template: > - {% set event_date = state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'] %} - {% set event_time = state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] %} - {% set event_datetime = strptime(event_date + ' ' + event_time, '%Y-%m-%d %H:%M') %} - {% set reminder_datetime = event_datetime - timedelta(days=2) %} - {% set rounded_reminder_datetime = reminder_datetime.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if reminder_datetime.minute >= 30 else 0) %} - - {% set now = now() %} - {% set rounded_now = (now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if now.minute >= 30 else 0)).replace(tzinfo=None) %} - - {{ rounded_reminder_datetime == rounded_now }} - - platform: template - value_template: > - {% set event_date = state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'] %} - {% set event_time = state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] %} - {% set event_datetime = strptime(event_date + ' ' + event_time, '%Y-%m-%d %H:%M') %} - {% set reminder_datetime = event_datetime - timedelta(days=1, hours=12) %} - {% set rounded_reminder_datetime = reminder_datetime.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if reminder_datetime.minute >= 30 else 0) %} - - {% set now = now() %} - {% set rounded_now = (now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if now.minute >= 30 else 0)).replace(tzinfo=None) %} - - {{ rounded_reminder_datetime == rounded_now }} - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball_on_warm_sundays.attributes.last_triggered) | int > 140200 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball_by_kadermanager_2_mannschaft.attributes.last_triggered) | int > 140200 }}" - action: - - choose: - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] != 'Spiel' }}" - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] == 'Spiel' }}" - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_tischabwischer - body: - text: - "{%- set date = strptime(state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] }} Uhr findet {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['title'] }} statt. Bisherige Kadermanager Zusagen: {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['in_count'] }} - - - Stimmt bitte fleißig im Kadermanager ab: - - {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['link'] }}" - - choose: - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] == 'Spiel' }}" - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_tischabwischer', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found == 'Dienstag' }} - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "Mannschaft 2 hat am {%- set date = strptime(state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] }} Uhr {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['title'] }}. - - Das Training findet somit bei Bedarf nur mit der 3. Mannschaft statt. {% set event = state_attr('sensor.kadermanager_tischabwischer', 'events')[0] %}{% if 'Heim' in event['title'] %} Wenn es freiwillige als Schiedsrichter gibt, meldet euch bitte!{% endif %}" - - choose: - - conditions: - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] == 'Spiel' }}" - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_tischabwischer', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found != 'Dienstag' }} - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_tischabwischer', 'events')[0] %} - {{ 'Heim' in event['title'] }} - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "Mannschaft 2 hat am {%- set date = strptime(state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] }} Uhr {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['title'] }}. - - Wer kann hier als Schiedsrichter pfeifen? Bitte melden!" - default: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_tischabwischer - body: - text: - "{%- set date = strptime(state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['date'], '%Y-%m-%d') %} - {%- set weekday = ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'] -%} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found }} ab {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['time'] }} Uhr findet {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['type'] }} {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['title'] }} statt. - - Bisherige Kadermanager Zusagen: {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['in_count'] }} - - - Stimmt bitte fleißig im Kadermanager ab: - - {{ state_attr('sensor.kadermanager_tischabwischer', 'events')[0]['link'] }}" - -- id: kadermanager_participant_count_reminder - alias: "Erinnerung an Teilnehmerzahl bei Kadermanager" - initial_state: true - trigger: - - platform: template - value_template: > - {% set event_date = state_attr('sensor.kadermanager_zorro', 'events')[0]['date'] %} - {% set event_time = state_attr('sensor.kadermanager_zorro', 'events')[0]['time'] %} - {% set event_datetime = strptime(event_date + ' ' + event_time, '%Y-%m-%d %H:%M') %} - {% set reminder_datetime = event_datetime - timedelta(hours=3) %} - {% set rounded_reminder_datetime = reminder_datetime.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if reminder_datetime.minute >= 30 else 0) %} - - {% set now = now() %} - {% set rounded_now = (now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1 if now.minute >= 30 else 0)).replace(tzinfo=None) %} - - {{ rounded_reminder_datetime == rounded_now }} - condition: - condition: and - conditions: - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_participant_count_on_kadermanager.attributes.last_triggered) | int > 64800 }}" - - condition: template - value_template: "{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['type'] != 'Spiel' }}" - action: - - choose: - - conditions: - - condition: template - value_template: > - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {{ 'Fabian S.' not in declined_players }} - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_fabian_distance - below: 20000 - - condition: state - entity_id: person.fabian - state: "home" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_fabian - data: - disable_web_page_preview: true - message: > - [Kadermanager]({{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }}) - Zusagen für heute: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - {% set accepted_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['accepted_players'] %} - {% if accepted_players %} - - - Zugesagt haben: - - {{ accepted_players | join(', ') }} - {% endif %} - - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {% if declined_players %} - - Abgesagt haben: - - {{ declined_players | join(', ') }} - {% endif %} - - choose: - - conditions: - - condition: template - value_template: > - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {{ 'Samuel K' not in declined_players }} - - condition: or - conditions: - - condition: numeric_state - entity_id: sensor.smart_life_samuel_distance - below: 20000 - - condition: state - entity_id: person.samuel - state: "home" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_samuel - data: - disable_web_page_preview: true - message: > - [Kadermanager]({{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }}) - Zusagen für heute: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - {% set accepted_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['accepted_players'] %} - {% if accepted_players %} - - - Zugesagt haben: - - {{ accepted_players | join(', ') }} - {% endif %} - - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {% if declined_players %} - - Abgesagt haben: - - {{ declined_players | join(', ') }} - {% endif %} - - choose: - - conditions: - - condition: template - value_template: > - {% set event = state_attr('sensor.kadermanager_zorro', 'events')[0] %} - {% set date = strptime(event['date'], '%Y-%m-%d') %} - {% set weekday = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %} - {% set weekday_number = date.weekday() %} - {% set weekday_found = weekday[weekday_number] %} - {{ weekday_found == 'Dienstag' }} - - condition: template - value_template: > - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {{ 'Anton' not in declined_players }} - sequence: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_anton - body: - text: - "Kadermanager ({{ state_attr('sensor.kadermanager_zorro', 'events')[0]['link'] }}) - Zusagen für heute: {{ state_attr('sensor.kadermanager_zorro', 'events')[0]['in_count'] }} - {% set accepted_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['accepted_players'] %} - {% if accepted_players %} - - - Zugesagt haben: - - {{ accepted_players | join(', ') }} - {% endif %} - - {% set declined_players = state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] %} - {% if declined_players %} - - Abgesagt haben: - - {{ declined_players | join(', ') }} - {% endif %}" - -- id: remind_for_volleyball - alias: "remind for volleyball" - initial_state: false - trigger: - - platform: template - value_template: "{{ as_timestamp(now()) | round(-2) == (as_timestamp(states.calendar.volleyballtraining.attributes.start_time) - 172800) | round(-2) }}" - - platform: template - value_template: "{{ as_timestamp(now()) | round(-2) == (as_timestamp(states.calendar.volleyballtraining.attributes.start_time) - 140400) | round(-2) }}" - condition: - condition: and - conditions: - - condition: template - value_template: "{{ ((as_timestamp(states.calendar.volleyballtraining.attributes.start_time) - as_timestamp(now())) < 173000) and ((as_timestamp(states.calendar.volleyballtraining.attributes.start_time) - as_timestamp(now())) > 0) }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball_on_warm_sundays.attributes.last_triggered) | int > 140200 }}" - - condition: template - value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.remind_for_volleyball.attributes.last_triggered) | int > 140200 }}" - action: - #- service: shell_command.unpin_all_telegram - # data_template: - # telegram_bot_api: !secret telegram_bot_api - # chat_id: !secret telegram_volleyball - - service: telegram_bot.send_poll - data_template: - target: !secret telegram_volleyball - question: - "{%- set date = as_timestamp(states.calendar.volleyballtraining.attributes.start_time) -%} - {% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} {% set weekday_number = date | timestamp_custom('%w') | int %} - {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ab {{ as_timestamp(states.calendar.volleyballtraining.attributes.start_time) | timestamp_custom('%H:%M', true) }} Uhr findet {{ states.calendar.volleyballtraining.attributes.message }} statt. Ich komme? Kadermanagerabstimmung nicht vergessen." - options: - - "Ja" - - "Nein" - - "Vielleicht" - - "Nur zeitweise/verspätet" - is_anonymous: false - allows_multiple_answers: false - disable_notification: true - - choose: - - conditions: - - condition: template - value_template: "{{not is_state_attr('calendar.volleyballtraining', 'description', '')}}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_volleyball - data: - disable_web_page_preview: true - message: > - Zusatzinfos: {{ states.calendar.volleyballtraining.attributes.description }} - -- id: remind_for_volleyball_on_warm_sundays - alias: "Remind for Volleyball on warm Sundays" - initial_state: false - trigger: - - platform: time - at: "13:00:00" - condition: - condition: and - conditions: - - condition: time - weekday: - - fri - - condition: or - conditions: - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['condition'] == 'sunny' }}" - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['condition'] == 'partlycloudy' }}" - - condition: template - value_template: "{{state_attr('sensor.weather_ebersberg_daily', 'forecast')[2]['temperature'] | int >= 20 }}" - - condition: template - value_template: "{{ now().month <= 10 and now().month >= 4 }}" - action: - - service: shell_command.unpin_all_telegram - data_template: - telegram_bot_api: !secret telegram_bot_api - chat_id: !secret telegram_volleyball - - service: telegram_bot.send_poll - data_template: - target: !secret telegram_volleyball - question: - "{%- set date = as_timestamp(states.calendar.volleyballtraining.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} - {% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ist das Wetter gut: {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].condition }} - bei {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].temperature }}° und {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].wind_speed }} km/h Wind. - Ich komme zum Beachvolleyball ab {{ as_timestamp(states.calendar.volleyballtraining.attributes.start_time) | timestamp_custom('%H:%M', true) }} Uhr?" - options: - - "Ja" - - "Nein" - - "Vielleicht" - - "Nur zeitweise/verspätet" - is_anonymous: false - allows_multiple_answers: false - disable_notification: true - - choose: - - conditions: - - condition: template - value_template: "{{not is_state_attr('calendar.volleyballtraining', 'description', '')}}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_volleyball - data: - disable_web_page_preview: true - message: > - Zusatzinfos: {{ states.calendar.volleyballtraining.attributes.description }} - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_volleyball_group - body: - text: - "{%- set date = as_timestamp(states.calendar.volleyballtraining.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} - {% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ist das Wetter gut: {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].condition }} - bei {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].temperature }}° und {{ states.sensor.weather_ebersberg_daily.attributes.forecast[2].wind_speed }} km/h Wind. Beachvolleyball ab {{ as_timestamp(states.calendar.volleyballtraining.attributes.start_time) | timestamp_custom('%H:%M', true) }}?" - -- id: remind_for_juz - alias: "remind for juz" - initial_state: true - trigger: - - platform: template - value_template: "{{ as_timestamp(now()) | round(-2) == (as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) - 111600) | round(-2) }}" - condition: - condition: and - conditions: - - condition: template - value_template: "{{ ((as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) - as_timestamp(now())) < 112600) and ((as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) - as_timestamp(now())) > 0) }}" - action: - - service: telegram_bot.send_poll - data_template: - target: !secret telegram_chat_juz_group - question: - "Das JUZ hat {%- set date = as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} - {% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ab {{ as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) | timestamp_custom('%H:%M', true) }} - Uhr für {{ states.calendar.juz_zorneding_public.attributes.message }} geöffnet. Wir freuen uns auf euren Besuch! Ich komme?" - options: - - "Ja" - - "Nein" - - "Vielleicht" - is_anonymous: false - allows_multiple_answers: false - disable_notification: true - - choose: - - conditions: - - condition: template - value_template: "{{not is_state_attr('calendar.juz_zorneding_public', 'description', '')}}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_group - message: > - Zusatzinfo: {{ states.calendar.juz_zorneding_public.attributes.description }} - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_chat_juz_group - body: - text: - "Das JUZ hat{%- set date = as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} {% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ab {{ as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) | timestamp_custom('%H:%M', true) }} Uhr für {{ states.calendar.juz_zorneding_public.attributes.message }} geöffnet. Wir freuen uns auf euren Besuch! - Zusatzinfo: {{ states.calendar.juz_zorneding_public.attributes.description }}" - default: - - service: whatsapp.send_message - continue_on_error: true - data_template: - clientId: default - to: !secret whatsapp_chat_juz_group - body: - text: "Das JUZ hat{%- set date = as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) -%}{% set weekday = ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'] %} {% set weekday_number = date | timestamp_custom('%w') | int %} {% set weekday_found = weekday[weekday_number] %} {{weekday_found}} ab {{ as_timestamp(states.calendar.juz_zorneding_public.attributes.start_time) | timestamp_custom('%H:%M', true) }} Uhr für {{ states.calendar.juz_zorneding_public.attributes.message }} geöffnet. Wir freuen uns auf euren Besuch!" - -- id: send_juz_mails_to_telegram - alias: "send juz mails to telegram" - initial_state: true - trigger: - - platform: state - entity_id: sensor.juz_outlook - attribute: data - condition: - condition: and - conditions: - - condition: numeric_state - entity_id: sensor.juz_outlook - above: "0" - - condition: not - conditions: - - condition: state - entity_id: sensor.juz_outlook - state: unavailable - - condition: template - value_template: "{{ trigger.to_state.state|int > trigger.from_state.state|int }}" - - condition: state - entity_id: sensor.juz_outlook - attribute: data - state: "" - - condition: template - value_template: "{{'noreply@ionos.de' in state_attr('sensor.juz_outlook', 'data')[0]['sender'] }}" - - condition: template - value_template: "{{'Angenommen: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Abgelehnt: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Willkommen bei OTTO UP Plus' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'OTTO-Kundenkonto: Bitte E-Mail-Adresse bestätigen.' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Änderung der Datennutzung' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Deine Rechnung von OTTO' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Deine Bestellung wurde versandt.' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Vorläufig angenommen: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Aktualisierte Einladung: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Termin abgesagt: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Undeliverable: ' in state_attr('sensor.juz_outlook', 'data')[0]['subject'] }}" - action: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_mail - message: > - Neue Mail vom {{ as_timestamp(state_attr('sensor.juz_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - Absender: {{state_attr('sensor.juz_outlook', 'data')[0]['sender']}} - - - *Betreff:* {{state_attr('sensor.juz_outlook', 'data')[0]['subject']}} - - *Inhalt:* {{state_attr('sensor.juz_outlook', 'data')[0]['body'] | truncate(450)}} - -- id: send_5freunde_mails_to_telegram - alias: "send 5freunde mails to telegram" - initial_state: true - trigger: - - platform: state - entity_id: sensor.5freunde_outlook - attribute: data - condition: - condition: and - conditions: - - condition: numeric_state - entity_id: sensor.5freunde_outlook - above: "0" - - condition: not - conditions: - - condition: state - entity_id: sensor.5freunde_outlook - state: unavailable - - condition: state - entity_id: sensor.5freunde_outlook - attribute: data - state: "" - - condition: template - value_template: "{{ trigger.to_state.state|int > trigger.from_state.state|int }}" - - condition: template - value_template: "{{'Angenommen: ' in state_attr('sensor.5freunde_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Abgelehnt: ' in state_attr('sensor.5freunde_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Vorläufig angenommen: ' in state_attr('sensor.5freunde_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Aktualisierte Einladung: ' in state_attr('sensor.5freunde_outlook', 'data')[0]['subject'] }}" - - condition: template - value_template: "{{'Termin abgesagt: ' in state_attr('sensor.5freunde_outlook', 'data')[0]['subject'] }}" - action: - - choose: - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'PayPal' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - - condition: template - value_template: "{{'service@paypal.de' in state_attr('sensor.5freunde_outlook', 'data')[0]['sender'] }}" - sequence: - - choose: - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'Erhaltener Betrag' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - choose: - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'Mitteilung von' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal *Einnahme* vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(\d+\,?\d+) € EUR', index=0, ignorecase=False) }} € von: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<=Hallo Fabian Seitz!).*?(?= hat)', index=0, ignorecase=False) }} - - Für: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<=:).*?(?=Transaktionsdetails)', index=0, ignorecase=False) }} - - #PayPal #PayPalEinnahme - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal *Einnahme* vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(\d+\,?\d+) € EUR', index=0, ignorecase=False) }} € von: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<=Hallo Fabian Seitz!).*?(?= hat)', index=0, ignorecase=False) }} - - #PayPal #PayPalEinnahme - - choose: - - conditions: - - condition: template - value_template: "{{'Gebühr' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Achtung! Person hat nicht per PayPal Freunde bezahlt, daher sind Gebühren angefallen! - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'Geld gesendet' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - choose: - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'Ihre Mitteilung an' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal *Ausgabe* vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(\d+\,?\d+) € EUR', index=0, ignorecase=False) }} € an: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<= EUR an ).*?(?= gesendet)', index=0, ignorecase=False) }} - - Für: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<=Ihre Mitteilung an ).*?(?=Transaktionsdetails)', index=0, ignorecase=False) }} - - #PayPal #PayPalAusgabe - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal *Ausgabe* vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(\d+\,?\d+) € EUR', index=0, ignorecase=False) }} € an: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<= EUR an ).*?(?= gesendet)', index=0, ignorecase=False) }} - - #PayPal #PayPalAusgabe - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'Einkaufsbetrag' in state_attr('sensor.5freunde_outlook', 'data')[0]['body'] }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal *Ausgabe* vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(\d+\,?\d+) EUREmpfänger:', index=0, ignorecase=False) }} € an: {{ state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | regex_findall_index(find='(?<= EUR an ).*?(?= autorisiert)', index=0, ignorecase=False) }} - - #PayPal #PayPalAusgabe - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue PayPal Mail vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - *Inhalt:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | truncate(400)}} - - #PayPal - - conditions: - - condition: or - conditions: - - condition: template - value_template: "{{'juzzorneding@gmail.com' in state_attr('sensor.5freunde_outlook', 'data')[0]['to'] }}" - sequence: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_juz_leiter - message: > - Neue JUZ Gmail Mail vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - *Absender:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['sender']}} - - - *Betreff:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['subject']}} - - *Inhalt:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | truncate(400)}} - default: - - service: telegram_bot.send_message - data_template: - target: !secret telegram_chat_5friends - message: > - Neue Mail vom {{ as_timestamp(state_attr('sensor.5freunde_outlook', 'data')[0]['received']) | timestamp_custom("%d.%m.%Y %H:%M", true) }}: - - *Absender:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['sender']}} - - *Empfänger:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['to'][0]}} - - - *Betreff:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['subject']}} - - *Inhalt:* {{state_attr('sensor.5freunde_outlook', 'data')[0]['body'] | truncate(400)}} + - condit diff --git a/automation/telegram_commands.yaml b/automation/telegram_commands.yaml index 80e8e7e..fd1cebf 100644 --- a/automation/telegram_commands.yaml +++ b/automation/telegram_commands.yaml @@ -539,6 +539,10 @@ message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] + - service: homeassistant.reload_config_entry + data: + entry_id: 01J6EXEW32EBEDF3WV4VC0DA3C + - delay: "00:00:01" - service: telegram_bot.send_message data_template: title: "Zufallsessensvorschlag: " @@ -567,9 +571,6 @@ disable_notification: true inline_keyboard: - "Ja:/foodyes, Nein:/foodno" - - service: homeassistant.reload_config_entry - data: - entity_id: 01J6EXEW32EBEDF3WV4VC0DA3C - id: telegram_essen_vegan alias: Telegram Essen Vegan @@ -584,6 +585,10 @@ event_data: command: "/foodv@smartlife_ha_bot" action: + - service: homeassistant.reload_config_entry + data: + entry_id: 01J6EXEW32EBEDF3WV4VC0DA3C + - delay: "00:00:01" - service: telegram_bot.send_message data_template: title: "Veganer Zufallsessensvorschlag: " @@ -612,9 +617,6 @@ disable_notification: true inline_keyboard: - "Ja:/foodyes, Nein:/foodno" - - service: homeassistant.reload_config_entry - data: - entity_id: 01J6EXEW32EBEDF3WV4VC0DA3C - id: telegram_food_yes alias: "Telegram food yes" diff --git a/automations.yaml b/automations.yaml deleted file mode 100644 index 1403a6f..0000000 --- a/automations.yaml +++ /dev/null @@ -1,58 +0,0 @@ -- id: '1704620538731' - alias: Home Assistant Auto-update on a schedule base - description: '' - use_blueprint: - path: edwardtfn/auto_update_scheduled.yaml - input: - schedule_entity: schedule.homeassistant_updates - backup_bool: false - restart_bool: true - actions_pre_restart: - - service: hassio.addon_restart - metadata: {} - data: - addon: a0d7b954_ssh - actions_pre_update: - - service: notify.telegram_fabian - metadata: {} - data: - title: Homeassistant Updates werden installiert - message: '{{ updates_list }}' -- id: '1704620672780' - alias: Home Assistant Auto-update on a schedule base - description: '' - use_blueprint: - path: edwardtfn/auto_update_scheduled.yaml - input: - schedule_entity: schedule.homeassistant_updates - restart_bool: true - actions_pre_update: - - service: notify.telegram_fabian - metadata: {} - data: - title: Homeassistant Updates werden installiert - message: '{{ updates_list }}' - actions_pre_restart: - - service: hassio.addon_restart - metadata: {} - data: - addon: a0d7b954_ssh -- id: '1704620740472' - alias: Install HA Updates automatically - description: '' - use_blueprint: - path: edwardtfn/auto_update_scheduled.yaml - input: - schedule_entity: schedule.homeassistant_updates - restart_bool: true - actions_pre_restart: - - service: hassio.addon_restart - metadata: {} - data: - addon: a0d7b954_ssh - actions_pre_update: - - service: notify.telegram_fabian - metadata: {} - data: - title: Homeassistant Updates werden installiert - message: '{{ updates_list }}' diff --git a/configuration.yaml b/configuration.yaml index 18fd06a..461924e 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -170,7 +170,7 @@ logger: # custom_components.boulderwelt: debug # custom_components.mvg: debug # custom_components.tasmota_fw_test: debug - custom_components.gh_release_tracker: debug + custom_components.dieliga: debug # Track the sun sun: diff --git a/sensor/sensor.yaml b/sensor/sensor.yaml index d55de6c..ae1e852 100644 --- a/sensor/sensor.yaml +++ b/sensor/sensor.yaml @@ -40,6 +40,39 @@ # scan_interval: 86400 - platform: template sensors: +# outdated_tasmota_devices: +# friendly_name: "Outdated Tasmota Devices" +# unique_id: "outdated_tasmota_devices" +# value_template: > +# {% set latest_tag = states('sensor.arendst_tasmota_latest_tag') %} +# {% if latest_tag != 'unavailable' and latest_tag is not none %} +# {% set latest_version = latest_tag[1:] %} # "v" entfernen +# {% set latest_parts = latest_version.split('.') %} +# {% set outdated_count = 0 %} + +# {%- for entity in integration_entities('tasmota') -%} +# {% if device_attr(entity, 'sw_version') %} +# {% set firmware_version = device_attr(entity, 'sw_version') %} +# {% if latest_version > firmware_version %} +# {% set outdated_count = outdated_count + 1 %} +# {% endif %} +# {% endif %} +# {% endfor %} + +# {%- for entity in integration_entities('mqtt') -%} +# {% if device_attr(entity, 'sw_version') %} +# {% set firmware_version = device_attr(entity, 'sw_version') %} +# {% if latest_version > firmware_version %} +# {% set outdated_count = outdated_count + 1 %} +# {% endif %} +# {% endif %} +# {% endfor %} + +# {{ outdated_count }} +# {% else %} +# 0 +# {% endif %} + average_house_humidity: friendly_name: "Durchschn. Luftfeuchtigkeit" unique_id: "average_house_humidity_sensor" @@ -210,30 +243,60 @@ unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_ost_monday_avg') }}" + boulderwelt_ost_monday_avg_2h: + unique_id: "boulderwelt_ost_monday_avg_2h" + friendly_name: "Boulderwelt Ost Montag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_ost_monday_avg_2h') }}" + boulderwelt_ost_tuesday_avg: unique_id: "boulderwelt_ost_tuesday_avg" friendly_name: "Boulderwelt Ost Dienstag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_ost_tuesday_avg') }}" + boulderwelt_ost_tuesday_avg_2h: + unique_id: "boulderwelt_ost_tuesday_avg_2h" + friendly_name: "Boulderwelt Ost Dienstag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_ost_tuesday_avg_2h') }}" + boulderwelt_ost_wednesday_avg: unique_id: "boulderwelt_ost_wednesday_avg" friendly_name: "Boulderwelt Ost Mittwoch Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_ost_wednesday_avg') }}" + boulderwelt_ost_wednesday_avg_2h: + unique_id: "boulderwelt_ost_wednesday_avg_2h" + friendly_name: "Boulderwelt Ost Mittwoch Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_ost_wednesday_avg_2h') }}" + boulderwelt_ost_thursday_avg: unique_id: "boulderwelt_ost_thursday_avg" friendly_name: "Boulderwelt Ost Donnerstag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_ost_thursday_avg') }}" + boulderwelt_ost_thursday_avg_2h: + unique_id: "boulderwelt_ost_thursday_avg_2h" + friendly_name: "Boulderwelt Ost Donnerstag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_ost_thursday_avg_2h') }}" + boulderwelt_ost_friday_avg: unique_id: "boulderwelt_ost_friday_avg" friendly_name: "Boulderwelt Ost Freitag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_ost_friday_avg') }}" + boulderwelt_ost_friday_avg_2h: + unique_id: "boulderwelt_ost_friday_avg_2h" + friendly_name: "Boulderwelt Ost Freitag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_ost_friday_avg_2h') }}" + #Sued boulderwelt_sued_monday_avg: unique_id: "boulderwelt_sued_monday_avg" @@ -241,30 +304,60 @@ unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_sued_monday_avg') }}" + boulderwelt_sued_monday_avg_2h: + unique_id: "boulderwelt_sued_monday_avg_2h" + friendly_name: "Boulderwelt Sued Montag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_sued_monday_avg_2h') }}" + boulderwelt_sued_tuesday_avg: unique_id: "boulderwelt_sued_tuesday_avg" friendly_name: "Boulderwelt Sued Dienstag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_sued_tuesday_avg') }}" + boulderwelt_sued_tuesday_avg_2h: + unique_id: "boulderwelt_sued_tuesday_avg_2h" + friendly_name: "Boulderwelt Sued Dienstag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_sued_tuesday_avg_2h') }}" + boulderwelt_sued_wednesday_avg: unique_id: "boulderwelt_sued_wednesday_avg" friendly_name: "Boulderwelt Sued Mittwoch Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_sued_wednesday_avg') }}" + boulderwelt_sued_wednesday_avg_2h: + unique_id: "boulderwelt_sued_wednesday_avg_2h" + friendly_name: "Boulderwelt Sued Mittwoch Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_sued_wednesday_avg_2h') }}" + boulderwelt_sued_thursday_avg: unique_id: "boulderwelt_sued_thursday_avg" friendly_name: "Boulderwelt Sued Donnerstag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_sued_thursday_avg') }}" + boulderwelt_sued_thursday_avg_2h: + unique_id: "boulderwelt_sued_thursday_avg_2h" + friendly_name: "Boulderwelt Sued Donnerstag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_sued_thursday_avg_2h') }}" + boulderwelt_sued_friday_avg: unique_id: "boulderwelt_sued_friday_avg" friendly_name: "Boulderwelt Sued Freitag Durchschnitt" unit_of_measurement: "%" value_template: "{{ states('input_number.boulderwelt_sued_friday_avg') }}" + boulderwelt_sued_friday_avg_2h: + unique_id: "boulderwelt_sued_friday_avg_2h" + friendly_name: "Boulderwelt Sued Freitag Durchschnitt 2h" + unit_of_measurement: "%" + value_template: "{{ states('input_number.boulderwelt_sued_friday_avg_2h') }}" + boulderwelt_sued_saturday_avg: unique_id: "boulderwelt_sued_saturday_avg" friendly_name: "Boulderwelt Sued Samstag Durchschnitt" @@ -286,6 +379,15 @@ hours: 24 sampling_size: 24 +- platform: statistics + name: "Boulderwelt München Ost Level Mean 2h" + unique_id: "boulderwelt_munchen_ost_level_mean_2h" + entity_id: sensor.boulderwelt_munchen_ost_level + state_characteristic: mean + max_age: + hours: 2 + sampling_size: 2 + - platform: statistics name: "Boulderwelt München Sued Level Mean" unique_id: "boulderwelt_munchen_sued_level_mean" @@ -294,3 +396,12 @@ max_age: hours: 24 sampling_size: 24 + +- platform: statistics + name: "Boulderwelt München Sued Level Mean 2h" + unique_id: "boulderwelt_munchen_sued_level_mean_2h" + entity_id: sensor.boulderwelt_munchen_sud_level + state_characteristic: mean + max_age: + hours: 2 + sampling_size: 2 \ No newline at end of file