- Gæstetilstand: ny gaester.yaml, udvidet guest_mode og guest_automations_off; lys_stue, gardiner m.fl. respekterer input_boolean.gaester - Varme: nye standardværdier (komfort stue/andreas/daniel, bryggers/køkken 23, nat-/væk-sænkning) - Nye filer: garage_anne_evening.yaml, input/boolean/vanding.yaml - Diverse justeringer af lys-, ferie- og vandingsautomationer samt dashboards - HA-version og mealie.json opdateret Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
- alias: Andreas lys motion
|
|
mode: restart
|
|
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.hue_motion_sensor_2_motion_2
|
|
to: "on"
|
|
id: motion_on
|
|
|
|
- platform: state
|
|
entity_id: binary_sensor.hue_motion_sensor_2_motion_2
|
|
to: "off"
|
|
id: motion_off
|
|
|
|
variables:
|
|
lux_limit: "{{ states('input_number.andreas_lux_threshold') | int }}"
|
|
brightness: "{{ states('input_number.andreas_brightness') | int }}"
|
|
timeout: "{{ states('input_number.andreas_timeout') | int }}"
|
|
|
|
action:
|
|
|
|
- choose:
|
|
|
|
# Motion detected
|
|
- conditions:
|
|
- condition: trigger
|
|
id: motion_on
|
|
|
|
# ⚠️ Skift numeric_state til template condition
|
|
- condition: template
|
|
value_template: >
|
|
{{ states('sensor.hue_motion_sensor_2_illuminance_2') | int < lux_limit }}
|
|
|
|
- condition: template
|
|
value_template: >
|
|
{% set t = now().strftime('%H%M') | int %}
|
|
{% if is_state('binary_sensor.arbejdsdag','on') %}
|
|
{{ 700 <= t <= 1945 }}
|
|
{% else %}
|
|
{{ 1000 <= t <= 2030 }}
|
|
{% endif %}
|
|
|
|
# Ikke syg
|
|
- 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
|
|
target:
|
|
entity_id: light.andreas_vaerelse
|
|
data:
|
|
brightness_pct: "{{ brightness }}"
|
|
|
|
# Motion stopped
|
|
- conditions:
|
|
- condition: trigger
|
|
id: motion_off
|
|
|
|
sequence:
|
|
|
|
- delay:
|
|
minutes: "{{ timeout }}"
|
|
|
|
- condition: state
|
|
entity_id: binary_sensor.hue_motion_sensor_2_motion_2
|
|
state: "off"
|
|
|
|
- service: light.turn_off
|
|
target:
|
|
entity_id: light.andreas_vaerelse
|