From 08ef7f1a6189cd57c8e50faa046ec6252ac695bf Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Sun, 27 Sep 2026 15:26:19 +0200 Subject: [PATCH] Gardiner: alt ned foelger solnedgang, tidligst kl 18 og senest kl 21 --- .HA_VERSION | 2 +- configuration.yaml | 4 +- dashboards/views/06c_indkorsel_snapshots.yaml | 2 +- include/automations/gardiner.yaml | 34 +++++++++++++- include/automations/mealie.yaml | 23 +++++----- include/automations/sonos_alarm_fallback.yaml | 46 +++++++++++++++++++ www/mealie.json | 2 +- 7 files changed, 95 insertions(+), 18 deletions(-) create mode 100644 include/automations/sonos_alarm_fallback.yaml diff --git a/.HA_VERSION b/.HA_VERSION index 4424496..bba4b7a 100755 --- a/.HA_VERSION +++ b/.HA_VERSION @@ -1 +1 @@ -2026.9.1 \ No newline at end of file +2026.9.3 \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index efaf0e9..8651c51 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -19,9 +19,6 @@ homeassistant: country: DK allowlist_external_dirs: - /config - # Tillad color_extractor at hente albumcovers via media_player_proxy - allowlist_external_urls: - - "http://localhost:8123" media_dirs: local: /config/www/media @@ -179,6 +176,7 @@ input_select: !include_dir_merge_named include/input/select/ input_boolean: !include_dir_merge_named include/input/boolean/ input_text: !include_dir_merge_named include/input/text/ light: !include_dir_merge_list include/lights/ +panel_iframe: !include_dir_merge_named include/panels/ script: !include_dir_merge_named include/scripts/ shell_command: !include_dir_merge_named include/shell_commands/ switch: !include_dir_merge_list include/switches/ diff --git a/dashboards/views/06c_indkorsel_snapshots.yaml b/dashboards/views/06c_indkorsel_snapshots.yaml index b8cb22c..d53f0a9 100644 --- a/dashboards/views/06c_indkorsel_snapshots.yaml +++ b/dashboards/views/06c_indkorsel_snapshots.yaml @@ -5,5 +5,5 @@ panel: true cards: - type: iframe - url: /local/snapshots/indkorsel_loader.html?v=20260910190142 + url: /local/snapshots/indkorsel_loader.html?v=20260927152451 aspect_ratio: 100% diff --git a/include/automations/gardiner.yaml b/include/automations/gardiner.yaml index 79a7201..54e6189 100644 --- a/include/automations/gardiner.yaml +++ b/include/automations/gardiner.yaml @@ -50,10 +50,42 @@ target: entity_id: scene.morgen -- alias: 'Gardiner - alt ned kl 21' +- alias: 'Gardiner - alt ned ved solnedgang (tidligst 18, senest 21)' trigger: + - platform: sun + event: sunset + id: solnedgang + - platform: time + at: '18:00:00' + id: kl18 - platform: time at: '21:00:00' + id: kl21 + condition: + - condition: or + conditions: + # Solnedgang mellem 18 og 21 -> kør ved solnedgang + - condition: and + conditions: + - condition: trigger + id: solnedgang + - condition: time + after: '18:00:00' + before: '21:00:00' + # Solen allerede gået ned kl 18 -> kør kl 18 + - condition: and + conditions: + - condition: trigger + id: kl18 + - condition: sun + after: sunset + # Solen ikke gået ned kl 21 endnu -> kør kl 21 + - condition: and + conditions: + - condition: trigger + id: kl21 + - condition: sun + before: sunset action: - service: scene.turn_on target: diff --git a/include/automations/mealie.yaml b/include/automations/mealie.yaml index 7530dad..6ae8065 100644 --- a/include/automations/mealie.yaml +++ b/include/automations/mealie.yaml @@ -1,14 +1,15 @@ -- id: mealie_generate_bilka_checklist_wednesday - alias: "Mealie indkøbsliste - onsdag morgen" - trigger: - - platform: time - at: "06:30:00" - condition: - - condition: time - weekday: - - wed - action: - - service: script.mealie_shopping_refresh +# Slået fra 15/9 2026 - erstattet af OpenClaw-løsning +# - id: mealie_generate_bilka_checklist_wednesday +# alias: "Mealie indkøbsliste - onsdag morgen" +# trigger: +# - platform: time +# at: "06:30:00" +# condition: +# - condition: time +# weekday: +# - wed +# action: +# - service: script.mealie_shopping_refresh - id: mealie_update_mealplan alias: "Mealie opdater madplan" diff --git a/include/automations/sonos_alarm_fallback.yaml b/include/automations/sonos_alarm_fallback.yaml new file mode 100644 index 0000000..90395bf --- /dev/null +++ b/include/automations/sonos_alarm_fallback.yaml @@ -0,0 +1,46 @@ +# Fallback når Sonos-alarm 1782 (Soveværelse 06:01) fejler og spiller klokken. +# Spotify-opslag fejler intermitterende ved alarmtid (se memory: sonos-alarmer). +# Fejl-signatur: player er idle eller spiller uden titel få sekunder efter 06:01. +- alias: 'Sonos alarm fallback soveværelse' + id: sonos_alarm_fallback_sovevaerelse + mode: single + trigger: + - platform: time + at: '06:01:45' + condition: + # Alarm-switchen tændes kun aftenen før arbejdsdage (og ikke ved sygdom) + - condition: state + entity_id: switch.sonos_alarm_1782 + state: 'on' + # Alarmen er fejlet hvis der ikke spilles musik med titel nu + - condition: template + value_template: >- + {{ not (is_state('media_player.sovevaerelse', 'playing') + and (state_attr('media_player.sovevaerelse', 'media_title') or '') != '') }} + action: + - service: media_player.volume_set + target: + entity_id: media_player.sovevaerelse + data: + volume_level: 0.08 + - service: media_player.shuffle_set + target: + entity_id: media_player.sovevaerelse + data: + shuffle: true + # Samme playliste som alarmen: "Gentle wakeup" (Claus' egen kopi, via share-link) + - service: media_player.play_media + target: + entity_id: media_player.sovevaerelse + data: + media_content_type: music + media_content_id: 'https://open.spotify.com/playlist/2j6w6vpzFDkJ55348QsaW9' + - delay: '00:00:20' + # Nød-fallback: hvis Spotify slet ikke vil, så DR P3 (virker altid) + - condition: template + value_template: "{{ not is_state('media_player.sovevaerelse', 'playing') }}" + - service: media_player.select_source + target: + entity_id: media_player.sovevaerelse + data: + source: 'DR P3' diff --git a/www/mealie.json b/www/mealie.json index 3d5a1aa..3b22034 100644 --- a/www/mealie.json +++ b/www/mealie.json @@ -1 +1 @@ -{"count": 8, "items": [{"date": "2026-09-11", "recipe": {"name": "Coleslaw", "slug": "coleslaw"}}, {"date": "2026-09-11", "recipe": {"name": "SPARERIBS SOUS VIDE, 36 timers tilberedning", "slug": "spareribs-sous-vide-36-timers-tilberedning"}}, {"date": "2026-09-16", "recipe": {"name": "Rester \u2014 kylling i sennepssauce", "slug": ""}}, {"date": "2026-09-15", "recipe": {"name": "Rester \u2014 bolognese", "slug": ""}}, {"date": "2026-09-14", "recipe": {"name": "Kylling i cremet sennepssauce", "slug": "kylling-i-cremet-sennepssauce"}}, {"date": "2026-09-13", "recipe": {"name": "Spaghetti Bolognese - pasta med k\u00f8dsovs", "slug": "spaghetti-bolognese-pasta-med-kodsovs"}}, {"date": "2026-09-10", "recipe": {"name": "Burger med crispy kylling og avocado", "slug": "burger-med-crispy-kylling-og-avocado"}}, {"date": "2026-09-16", "recipe": {"name": "Pastasalat med kylling", "slug": "pastasalat-med-kylling"}}]} \ No newline at end of file +{"count": 7, "items": [{"date": "2026-10-03", "recipe": {"name": "Spaghetti Bolognese - pasta med k\u00f8dsovs", "slug": "spaghetti-bolognese-pasta-med-kodsovs"}}, {"date": "2026-10-02", "recipe": {"name": "Pasta med laks og fl\u00f8de", "slug": "pasta-med-laks-og-flode"}}, {"date": "2026-10-01", "recipe": {"name": "Gr\u00e6ske hakkeb\u00f8ffer med tzatziki og krydrede kartofler", "slug": "graeske-hakkeboffer-med-tzatziki-og-krydrede-kartofler"}}, {"date": "2026-09-29", "recipe": {"name": "rester paprikagryde", "slug": ""}}, {"date": "2026-09-27", "recipe": {"name": "Paprikagryde \u2013 en klassisk m\u00f8rbradgryde", "slug": "paprikagryde-en-klassisk-morbradgryde"}}, {"date": "2026-09-30", "recipe": {"name": "Rester \u2014 Panang karry", "slug": ""}}, {"date": "2026-09-28", "recipe": {"name": "Panang karry med kylling", "slug": "panang-karry-med-kylling"}}]} \ No newline at end of file