Skip to content

Commit

Permalink
automatic upload by server
Browse files Browse the repository at this point in the history
  • Loading branch information
FaserF committed Jun 19, 2024
1 parent 2451fe0 commit 8739689
Showing 1 changed file with 75 additions and 7 deletions.
82 changes: 75 additions & 7 deletions automation/automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@
- condition: state
entity_id: sensor.altpapier
state: "Morgen"
- condition: state
entity_id: sensor.restmull
state: "Morgen"
- condition: state
entity_id: sensor.gelber_sack
state: "Morgen"
- condition: template
value_template: "{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_waste_put_outside.attributes.last_triggered) | int > 86400 }}"
sequence:
Expand All @@ -377,7 +383,7 @@
- service: telegram_bot.send_message
data_template:
message: >
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %} abgeholt. Bitte rausstellen.
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %}{% if states.sensor.restmull.state == "Morgen" %}die schwarze Tonne{% endif %}{% if states.sensor.gelber_sack.state == "Morgen" %}die gelben Säcke{% endif %} abgeholt. Bitte rausstellen{% if states('sensor.restmull') == 'Morgen' or states('sensor.gelber_sack') == 'Morgen' %} solange es der Vermieter nicht macht{% endif %}.

Check failure on line 386 in automation/automations.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

386:501 [line-length] line too long (513 > 500 characters)
target: !secret telegram_chat_fabian
inline_keyboard:
- "Erledigt:/telegramwastedone"
Expand All @@ -392,7 +398,7 @@
- service: telegram_bot.send_message
data_template:
message: >
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %} abgeholt. Bitte rausstellen.
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %}{% if states.sensor.restmull.state == "Morgen" %}die schwarze Tonne{% endif %}{% if states.sensor.gelber_sack.state == "Morgen" %}die gelben Säcke{% endif %} abgeholt. Bitte rausstellen{% if states('sensor.restmull') == 'Morgen' or states('sensor.gelber_sack') == 'Morgen' %} solange es der Vermieter nicht macht{% endif %}.

Check failure on line 401 in automation/automations.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

401:501 [line-length] line too long (513 > 500 characters)
target: !secret telegram_chat_samuel
inline_keyboard:
- "Erledigt:/telegramwastedone"
Expand Down Expand Up @@ -5715,6 +5721,12 @@
- condition: state
entity_id: sensor.altpapier
state: "Morgen"
- condition: state
entity_id: sensor.restmull
state: "Morgen"
- condition: state
entity_id: sensor.gelber_sack
state: "Morgen"
- condition: state
entity_id: "input_boolean.abwesend_modus"
state: "off"
Expand All @@ -5730,7 +5742,7 @@
- service: telegram_bot.send_message
data_template:
message: >
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %} abgeholt. Bitte rausstellen.
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %}{% if states.sensor.restmull.state == "Morgen" %}die schwarze Tonne{% endif %}{% if states.sensor.gelber_sack.state == "Morgen" %}die gelben Säcke{% endif %} abgeholt. Bitte rausstellen{% if states('sensor.restmull') == 'Morgen' or states('sensor.gelber_sack') == 'Morgen' %} solange es der Vermieter nicht macht{% endif %}.

Check failure on line 5745 in automation/automations.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

5745:501 [line-length] line too long (505 > 500 characters)
target: !secret telegram_chat_fabian
inline_keyboard:
- "Erledigt:/telegramwastedone"
Expand All @@ -5743,7 +5755,7 @@
- service: telegram_bot.send_message
data_template:
message: >
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %} abgeholt. Bitte rausstellen.
Morgen wird {% if states.sensor.bioabfall.state == "Morgen" %}die Biomülltonne{% endif %}{% if states.sensor.altpapier.state == "Morgen" %}das Altpapier{% endif %}{% if states.sensor.restmull.state == "Morgen" %}die schwarze Tonne{% endif %}{% if states.sensor.gelber_sack.state == "Morgen" %}die gelben Säcke{% endif %} abgeholt. Bitte rausstellen{% if states('sensor.restmull') == 'Morgen' or states('sensor.gelber_sack') == 'Morgen' %} solange es der Vermieter nicht macht{% endif %}.

Check failure on line 5758 in automation/automations.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

5758:501 [line-length] line too long (505 > 500 characters)
target: !secret telegram_chat_samuel
inline_keyboard:
- "Erledigt:/telegramwastedone"
Expand Down Expand Up @@ -9941,7 +9953,19 @@
{% 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) %}
{% 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:
Expand Down Expand Up @@ -10160,7 +10184,19 @@
{% 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) %}
{% 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:
Expand Down Expand Up @@ -10234,7 +10270,9 @@
{%- 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'] }}
{{ 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:
Expand Down Expand Up @@ -10299,6 +10337,36 @@
Abgesagt haben:
{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] | join(', ') }}
- 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_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'] }}
Zugesagt haben:
{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['accepted_players'] | join(', ') }}
Abgesagt haben:
{{ state_attr('sensor.kadermanager_zorro', 'events')[0]['players']['declined_players'] | join(', ') }}"

- id: remind_for_volleyball
alias: "remind for volleyball"
Expand Down

0 comments on commit 8739689

Please sign in to comment.