diff --git a/.HA_VERSION b/.HA_VERSION index c06935f..392a847 100755 --- a/.HA_VERSION +++ b/.HA_VERSION @@ -1 +1 @@ -2026.9.4 \ No newline at end of file +2026.10.3 \ No newline at end of file diff --git a/dashboards/views/01_home.yaml b/dashboards/views/01_home.yaml index 6bc4cd8..17956c1 100644 --- a/dashboards/views/01_home.yaml +++ b/dashboards/views/01_home.yaml @@ -894,7 +894,7 @@ cards: - type: entities title: Modes entities: - - entity: input_boolean.guests_mode + - entity: input_boolean.gaester name: Vi har gæster icon: mdi:account-group - entity: input_boolean.vacation_mode diff --git a/dashboards/views/05b_vanding.yaml b/dashboards/views/05b_vanding.yaml index 0b61ced..a6758be 100644 --- a/dashboards/views/05b_vanding.yaml +++ b/dashboards/views/05b_vanding.yaml @@ -402,6 +402,8 @@ sections: - type: entities title: Automatiske tidspunkter entities: + - entity: input_boolean.vanding_saeson_aktiv + name: Automatisk vanding (sæson) - entity: input_datetime.vanding_morgen_tid name: Morgen – start - entity: input_datetime.vanding_aften_tid diff --git a/dashboards/views/06c_indkorsel_snapshots.yaml b/dashboards/views/06c_indkorsel_snapshots.yaml index 5426ed7..8cd254c 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=20261005220433 + url: /local/snapshots/indkorsel_loader.html?v=20261108130726 aspect_ratio: 100% diff --git a/include/automations/andreas_kommer_hjem_taend_lys.yaml b/include/automations/andreas_kommer_hjem_taend_lys.yaml index c569633..1355432 100644 --- a/include/automations/andreas_kommer_hjem_taend_lys.yaml +++ b/include/automations/andreas_kommer_hjem_taend_lys.yaml @@ -31,7 +31,10 @@ - variables: lights: > {% set base = ['light.indkorsel_2', 'light.garage'] %} - {% if now().isocalendar()[1] >= 42 or now().isocalendar()[1] <= 8 %} + {% set baghave_tilladt = not is_state('input_boolean.gaester', 'on') + or 9 <= now().hour < 22 %} + {% if baghave_tilladt and + (now().isocalendar()[1] >= 42 or now().isocalendar()[1] <= 8) %} {{ (base + ['light.extended_color_light_1']) | list }} {% else %} {{ base }} diff --git a/include/automations/gaester.yaml b/include/automations/gaester.yaml new file mode 100644 index 0000000..58d4abd --- /dev/null +++ b/include/automations/gaester.yaml @@ -0,0 +1,135 @@ +- id: gaester_tilstand_skifter + alias: Gæster - tilstand skifter + description: > + Kobler "Vi har gæster"-knappen (input_boolean.gaester) til scripts der + slår gæste-automationer og alarmer fra/til. + mode: restart + + trigger: + - platform: state + entity_id: input_boolean.gaester + from: "off" + to: "on" + id: "on" + - platform: state + entity_id: input_boolean.gaester + from: "on" + to: "off" + id: "off" + - platform: homeassistant + event: start + id: start + + action: + - choose: + - conditions: + - condition: state + entity_id: input_boolean.gaester + state: "on" + sequence: + - service: script.guest_mode_on + - conditions: + - condition: trigger + id: "off" + sequence: + - service: script.guest_mode_off + +- id: gaester_gardiner_morgen + alias: Gæster - gardiner ved første bevægelse og helt op kl. 9 + mode: single + trigger: + - platform: state + entity_id: binary_sensor.stue_bevaegelse + to: "on" + id: motion + - platform: time + at: "09:00:00" + id: open + condition: + - condition: state + entity_id: input_boolean.gaester + state: "on" + action: + - choose: + - conditions: + - condition: trigger + id: motion + - condition: time + after: "05:50:00" + before: "09:00:00" + - condition: state + entity_id: input_boolean.first_run + state: "off" + sequence: + - service: scene.turn_on + target: + entity_id: scene.morgen + - service: input_boolean.turn_on + target: + entity_id: input_boolean.first_run + - conditions: + - condition: trigger + id: open + sequence: + - service: cover.open_cover + target: + entity_id: cover.alle_gardiner + +- id: gaester_soendag_paamindelse + alias: Gæster - spørg søndag kl. 20 om gæstetilstand skal slås fra + mode: single + trigger: + - platform: time + at: "20:00:00" + condition: + - condition: time + weekday: + - sun + - condition: state + entity_id: input_boolean.gaester + state: "on" + action: + - variables: + confirm_action: "{{ 'GUEST_MODE_OFF_' ~ context.id }}" + keep_action: "{{ 'GUEST_MODE_KEEP_' ~ context.id }}" + - service: notify.mobile_app_claus_iphone_15pro + data: + title: "Gæstetilstand" + message: "Vil du slå gæstetilstand fra nu?" + data: + tag: gaester_soendag + actions: + - action: "{{ confirm_action }}" + title: "Slå fra" + - action: "{{ keep_action }}" + title: "Behold gæstetilstand" + - wait_for_trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "{{ confirm_action }}" + id: confirmed + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "{{ keep_action }}" + id: keep + - platform: state + entity_id: input_boolean.gaester + to: "off" + id: already_off + timeout: "04:00:00" + continue_on_timeout: true + - service: notify.mobile_app_claus_iphone_15pro + data: + message: clear_notification + data: + tag: gaester_soendag + - condition: template + value_template: "{{ wait.trigger is not none and wait.trigger.id == 'confirmed' }}" + - condition: state + entity_id: input_boolean.gaester + state: "on" + - service: input_boolean.turn_off + target: + entity_id: input_boolean.gaester diff --git a/include/automations/garage_anne_evening.yaml b/include/automations/garage_anne_evening.yaml new file mode 100644 index 0000000..aac6886 --- /dev/null +++ b/include/automations/garage_anne_evening.yaml @@ -0,0 +1,60 @@ +- id: garageport_anne_evening_close + alias: Garageport Anne - luk kl. 21 med mulighed for annullering + description: > + Varsl kl. 21 og luk efter to minutter, medmindre brugeren annullerer + eller porten lukkes i mellemtiden. Den eksisterende reminder er uændret. + mode: single + + trigger: + - platform: time + at: "21:00:00" + + condition: + - condition: state + entity_id: binary_sensor.garageport + state: "on" + + action: + - service: notify.mobile_app_claus_iphone_15pro + data: + title: "Garageport" + message: "Garageporten er åben og lukkes automatisk om 2 minutter. Tryk Annuller for at lade den stå åben." + data: + tag: garage_anne_evening_close + actions: + - action: CANCEL_GARAGE_ANNE_EVENING + title: "Annuller" + + - wait_for_trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: CANCEL_GARAGE_ANNE_EVENING + id: cancelled + - platform: state + entity_id: binary_sensor.garageport + to: "off" + id: closed + timeout: "00:02:00" + continue_on_timeout: true + + - service: notify.mobile_app_claus_iphone_15pro + data: + message: clear_notification + data: + tag: garage_anne_evening_close + + - choose: + - conditions: + - condition: template + value_template: "{{ wait.trigger is not none }}" + sequence: + - stop: "Aftenlukning annulleret, eller porten er allerede lukket" + + - condition: state + entity_id: binary_sensor.garageport + state: "on" + + - service: cover.close_cover + target: + entity_id: cover.anne diff --git a/include/automations/gardiner.yaml b/include/automations/gardiner.yaml index 54e6189..5305f1f 100644 --- a/include/automations/gardiner.yaml +++ b/include/automations/gardiner.yaml @@ -3,6 +3,9 @@ - platform: time at: '07:00:00' condition: + - condition: state + entity_id: input_boolean.gaester + state: 'off' - condition: state entity_id: binary_sensor.arbejdsdag state: 'on' @@ -16,6 +19,9 @@ - platform: time at: '09:00:00' condition: + - condition: state + entity_id: input_boolean.gaester + state: 'off' - condition: state entity_id: binary_sensor.arbejdsdag state: 'off' @@ -29,6 +35,9 @@ - platform: time at: '06:00:00' condition: + - condition: state + entity_id: input_boolean.gaester + state: 'off' - condition: state entity_id: binary_sensor.arbejdsdag state: 'on' @@ -42,6 +51,9 @@ - platform: time at: '07:00:00' condition: + - condition: state + entity_id: input_boolean.gaester + state: 'off' - condition: state entity_id: binary_sensor.arbejdsdag state: 'off' diff --git a/include/automations/ingen_hjemme_sluk_lys_og_sonos.yaml b/include/automations/ingen_hjemme_sluk_lys_og_sonos.yaml index 16b1d81..e3e8e85 100644 --- a/include/automations/ingen_hjemme_sluk_lys_og_sonos.yaml +++ b/include/automations/ingen_hjemme_sluk_lys_og_sonos.yaml @@ -7,6 +7,10 @@ to: "off" for: minutes: 2 + condition: + - condition: state + entity_id: input_boolean.gaester + state: "off" action: - service: light.turn_off target: diff --git a/include/automations/lys_andreas.yaml b/include/automations/lys_andreas.yaml index ee8dd1e..e4d663c 100644 --- a/include/automations/lys_andreas.yaml +++ b/include/automations/lys_andreas.yaml @@ -44,6 +44,12 @@ - condition: template value_template: "{{ not is_state('input_select.andreas_status', 'syg') }}" + # Gæster: ingen motion-lys om natten (22-09) + - condition: template + value_template: > + {{ not is_state('input_boolean.gaester', 'on') or + 900 <= now().strftime('%H%M') | int < 2200 }} + sequence: - service: light.turn_on diff --git a/include/automations/lys_daniel.yaml b/include/automations/lys_daniel.yaml index 6238d6d..3249f9c 100644 --- a/include/automations/lys_daniel.yaml +++ b/include/automations/lys_daniel.yaml @@ -38,6 +38,11 @@ {% endif %} - condition: template value_template: "{{ not is_state('input_select.daniel_status', 'syg') }}" + # Gæster: ingen motion-lys om natten (22-09) + - condition: template + value_template: > + {{ not is_state('input_boolean.gaester', 'on') or + 900 <= now().strftime('%H%M') | int < 2200 }} sequence: - service: light.turn_on target: diff --git a/include/automations/lys_gang.yaml b/include/automations/lys_gang.yaml index 8eb9129..af589ff 100644 --- a/include/automations/lys_gang.yaml +++ b/include/automations/lys_gang.yaml @@ -17,7 +17,11 @@ lux_limit: "{{ states('input_number.gang_lux_threshold') | int }}" is_dag: > {% set t = now().strftime('%H%M') | int %} - {% if is_state('binary_sensor.arbejdsdag', 'on') %} + {% set arbejdsdag = is_state('binary_sensor.arbejdsdag', 'on') %} + {% set start = 630 if arbejdsdag else 800 %} + {% if is_state('input_boolean.gaester', 'on') %} + {{ start <= t < 2300 }} + {% elif arbejdsdag %} {{ 630 <= t < 2130 }} {% else %} {{ 800 <= t < 2200 }} diff --git a/include/automations/lys_kontor.yaml b/include/automations/lys_kontor.yaml index 7cc6719..936f7f4 100644 --- a/include/automations/lys_kontor.yaml +++ b/include/automations/lys_kontor.yaml @@ -12,6 +12,11 @@ value_template: > {{ states('sensor.kontor_belysningsstyrke') | int < states('input_number.kontor_lux_threshold') | int }} + # Gæster: ingen motion-lys om natten (22-09) + - condition: template + value_template: > + {{ not is_state('input_boolean.gaester', 'on') or + 900 <= now().strftime('%H%M') | int < 2200 }} action: - service: scene.turn_on diff --git a/include/automations/lys_stue.yaml b/include/automations/lys_stue.yaml index aa0e1d0..0a05ca2 100644 --- a/include/automations/lys_stue.yaml +++ b/include/automations/lys_stue.yaml @@ -46,6 +46,10 @@ {% endif %} action: + # Gæster styrer stuen manuelt, også ved sengetid. + - condition: state + entity_id: input_boolean.gaester + state: "off" - choose: # Motion on: taend lys hvis lux lavt @@ -57,15 +61,6 @@ {{ states('sensor.stue_belysningsstyrke') | int < lux_limit }} sequence: - choose: - # Gæster: altid Annes favorit uanset tidspunkt - - conditions: - - condition: state - entity_id: input_boolean.gaester - state: "on" - sequence: - - service: scene.turn_on - target: - entity_id: scene.stue_annes_favorit - conditions: - condition: template value_template: "{{ dagperiode == 'morgen' }}" @@ -118,6 +113,9 @@ value_template: > {{ dagperiode not in ('aften','aften_lys') or is_state('media_player.samsung', 'off') }} + - condition: state + entity_id: input_boolean.gaester + state: "off" - service: light.turn_off target: entity_id: light.livingroom @@ -137,6 +135,9 @@ - condition: state entity_id: media_player.samsung state: "off" + - condition: state + entity_id: input_boolean.gaester + state: "off" - service: light.turn_off target: entity_id: light.livingroom @@ -171,6 +172,9 @@ - platform: time_pattern minutes: "/30" condition: + - condition: state + entity_id: input_boolean.gaester + state: "off" - condition: time after: "00:00:00" before: "05:31:00" diff --git a/include/automations/lysvedgarage.yaml b/include/automations/lysvedgarage.yaml index 60d229c..fb588d5 100644 --- a/include/automations/lysvedgarage.yaml +++ b/include/automations/lysvedgarage.yaml @@ -7,6 +7,11 @@ - condition: numeric_state entity_id: sensor.indkorsel_sensor_illuminance below: 90 + # Gæster: kun baghaven (drivhus, paradis og Hue "baghave") spærres 22-09. + - condition: template + value_template: > + {{ not is_state('input_boolean.gaester', 'on') or + 900 <= now().strftime('%H%M') | int < 2200 }} # - condition: time # before: '23:00:00' @@ -43,4 +48,3 @@ entity_id: light.extended_color_light_1 - diff --git a/include/automations/vacation_end.yaml b/include/automations/vacation_end.yaml index f96a57c..d124066 100644 --- a/include/automations/vacation_end.yaml +++ b/include/automations/vacation_end.yaml @@ -12,7 +12,7 @@ value_template: > {% set dt = states('input_datetime.vacation_end') %} {{ dt not in ['unknown','unavailable',''] and - now() >= as_datetime(dt) }} + as_timestamp(now()) >= as_timestamp(dt) }} action: - service: input_boolean.turn_off diff --git a/include/automations/vacation_recovery.yaml b/include/automations/vacation_recovery.yaml index 5ffe7ed..31c8700 100644 --- a/include/automations/vacation_recovery.yaml +++ b/include/automations/vacation_recovery.yaml @@ -15,7 +15,7 @@ value_template: > {% set dt = states('input_datetime.vacation_end') %} {{ dt not in ['unknown','unavailable',''] and - now() >= as_datetime(dt) }} + as_timestamp(now()) >= as_timestamp(dt) }} sequence: - service: input_boolean.turn_off target: diff --git a/include/automations/vanding.yaml b/include/automations/vanding.yaml index 4b71c02..45a777f 100644 --- a/include/automations/vanding.yaml +++ b/include/automations/vanding.yaml @@ -2,6 +2,10 @@ trigger: platform: time at: input_datetime.vanding_morgen_tid + condition: + - condition: state + entity_id: input_boolean.vanding_saeson_aktiv + state: 'on' action: - service: script.vanding_hojbed_skiftevis @@ -9,6 +13,10 @@ trigger: platform: time at: input_datetime.vanding_aften_tid + condition: + - condition: state + entity_id: input_boolean.vanding_saeson_aktiv + state: 'on' action: - service: script.vanding_hojbed_skiftevis @@ -103,6 +111,9 @@ - platform: time_pattern minutes: 0 condition: + - condition: state + entity_id: input_boolean.vanding_saeson_aktiv + state: 'on' # Er denne time et af de N tidspunkter jævnt fordelt mellem kl. 9 og 21? # input_number.vanding_kapillaer_antal styrer antallet (0 = slået fra). - condition: template @@ -192,4 +203,3 @@ entity_id: select.vanding_liter data: option: "{{ trigger.id }}" - diff --git a/include/groups/groups.yaml b/include/groups/groups.yaml index caabb2c..651075f 100644 --- a/include/groups/groups.yaml +++ b/include/groups/groups.yaml @@ -31,9 +31,7 @@ Varme: guest_automations_off: entities: - - automation.der_er_nogen_i_indkorslen - - automation.godmorgen - - automation.godmorgen_children_arbejdsdag + - automation.godmorgen_rul_gardin_lidt_op_og_taend_lys_i_stue - automation.godnat - automation.gruppe_kokken_uden_stue_alrum - automation.gruppe_kokken_stue_alrum @@ -41,14 +39,11 @@ guest_automations_off: - automation.lys_sovevaerelse_dag_arbejdsdag - automation.lys_sovevaerelse_dag_ikke_arbejdsdag - automation.sunset_stuff_on + # Alarm-automationer der tænder Sonos-alarmer (inkl. "genaktiver" efter sygdom) - automation.turn_on_alarms_andreas - - automation.turn_on_alarms_andreas_saturdays - - automation.turn_on_alarms_andreas_tuesdays - automation.turn_on_alarms_badevaerelse - - automation.turn_on_alarms_badevaerelse_afsted - automation.turn_on_alarms_daniel - - automation.turn_on_alarms_daniel_afsted + - automation.turn_on_alarms_daniel_saturdays - automation.turn_on_alarms_soft_wakeup - - - + - automation.syg_daniel_genaktiver_alarmer + - automation.syg_sovevaerelse_genaktiver_alarmer diff --git a/include/input/boolean/vanding.yaml b/include/input/boolean/vanding.yaml new file mode 100644 index 0000000..1c2b709 --- /dev/null +++ b/include/input/boolean/vanding.yaml @@ -0,0 +1,3 @@ +vanding_saeson_aktiv: + name: Automatisk vanding (sæson) + icon: mdi:sprinkler-variant diff --git a/include/input/number/varme.yaml b/include/input/number/varme.yaml index 9f11ff6..a421624 100644 --- a/include/input/number/varme.yaml +++ b/include/input/number/varme.yaml @@ -5,7 +5,7 @@ varme_komfort_andreas: max: 28 step: 0.5 unit_of_measurement: "°C" - initial: 19 + initial: 20 icon: mdi:thermometer varme_komfort_daniel: @@ -14,7 +14,7 @@ varme_komfort_daniel: max: 28 step: 0.5 unit_of_measurement: "°C" - initial: 19 + initial: 20 icon: mdi:thermometer varme_komfort_sovevaerelse: @@ -77,7 +77,7 @@ varme_komfort_stue: max: 28 step: 0.5 unit_of_measurement: "°C" - initial: 23.5 + initial: 24 icon: mdi:thermometer # Globale sænkninger @@ -87,7 +87,7 @@ varme_nat_saenkning: max: 8 step: 0.5 unit_of_measurement: "°C" - initial: 3 + initial: 2 icon: mdi:weather-night varme_vaek_saenkning: @@ -96,7 +96,7 @@ varme_vaek_saenkning: max: 8 step: 0.5 unit_of_measurement: "°C" - initial: 3 + initial: 1.5 icon: mdi:home-export-outline varme_ferie_temp: @@ -114,7 +114,7 @@ varme_komfort_bryggers: max: 28 step: 0.5 unit_of_measurement: "°C" - initial: 20 + initial: 23 icon: mdi:thermometer varme_komfort_kokken: @@ -123,5 +123,5 @@ varme_komfort_kokken: max: 28 step: 0.5 unit_of_measurement: "°C" - initial: 20 + initial: 23 icon: mdi:thermometer diff --git a/include/scripts/guest_mode.yaml b/include/scripts/guest_mode.yaml index 1417e69..4701956 100644 --- a/include/scripts/guest_mode.yaml +++ b/include/scripts/guest_mode.yaml @@ -1,12 +1,34 @@ guest_mode_on: sequence: - service: automation.turn_off - entity_id: - - group.guest_automations_off + target: + entity_id: group.guest_automations_off + # Slå Sonos-alarmer fra der allerede er tændt (fx Daniels lørdagsalarm) + - service: switch.turn_off + target: + entity_id: + - switch.sonos_alarm_1782 # Soft wakeup + - switch.sonos_alarm_298 # Badeværelse + - switch.sonos_alarm_377 # Daniel hverdag + - switch.sonos_alarm_445 # Andreas hverdag + - switch.sonos_alarm_3471 # Daniel lørdag guest_mode_off: sequence: - service: automation.turn_on - entity_id: - - group.guest_automations_off - + target: + entity_id: group.guest_automations_off + # Efter kl. 20:09 har aftenens alarm-automationer allerede kørt (og var slået fra), + # så kør dem nu. Betingelserne (arbejdsdag i morgen, ikke syg) vurderes som normalt. + - condition: template + value_template: "{{ now().strftime('%H%M') | int >= 2009 }}" + - service: automation.trigger + target: + entity_id: + - automation.turn_on_alarms_soft_wakeup + - automation.turn_on_alarms_andreas + - automation.turn_on_alarms_badevaerelse + - automation.turn_on_alarms_daniel + - automation.turn_on_alarms_daniel_saturdays + data: + skip_condition: false diff --git a/www/mealie.json b/www/mealie.json index 049f13f..e436bd2 100644 --- a/www/mealie.json +++ b/www/mealie.json @@ -1 +1 @@ -{"count": 4, "items": [{"date": "2026-10-06", "recipe": {"name": "Lasagne", "slug": "lasagne"}}, {"date": "2026-10-08", "recipe": {"name": "Rester fra Kylling i Karry a la Ristaffel", "slug": ""}}, {"date": "2026-10-09", "recipe": {"name": "Laks med sesam og citron", "slug": "laks-med-sesam-og-citron"}}, {"date": "2026-10-07", "recipe": {"name": "Pastasalat med kylling", "slug": "pastasalat-med-kylling"}}]} \ No newline at end of file +{"count": 6, "items": [{"date": "2026-11-14", "recipe": {"name": "Tagliata med rucola og parmesan", "slug": "tagliata-med-rucola-og-parmesan"}}, {"date": "2026-11-13", "recipe": {"name": "Pasta med laks og fl\u00f8de", "slug": "pasta-med-laks-og-flode"}}, {"date": "2026-11-09", "recipe": {"name": "Rester (bolognese)", "slug": ""}}, {"date": "2026-11-10", "recipe": {"name": "Rester", "slug": ""}}, {"date": "2026-11-08", "recipe": {"name": "Spaghetti Bolognese - pasta med k\u00f8dsovs", "slug": "spaghetti-bolognese-pasta-med-kodsovs"}}, {"date": "2026-11-11", "recipe": {"name": "Pastasalat med kylling", "slug": "pastasalat-med-kylling"}}]} \ No newline at end of file