# Reviewvoorbeeld, geen export van de woning van de eigenaar. # Home Assistant package: vervang uitsluitend de twee voorbeeld-entiteiten # door een eigen bewegingssensor en een eigen dimbare lamp. # Begin met de automatische regeling uit. Schakel haar pas na controle in. # Handbediening via Hue-app/fysieke knop wordt niet universeel herkend: # zet daarvoor eerst input_boolean.hs_keuken_licht_auto uit. input_boolean: hs_keuken_licht_auto: name: Keukenlicht automatisch initial: false hs_keuken_licht_sessie: name: Keukenlicht tijdelijke stand actief initial: false timer: hs_keuken_licht_rust: name: Keukenlicht rusttijd duration: "00:05:00" restore: false automation: - id: hs_keuken_licht_vorige_stand alias: Keukenlicht tijdelijk feller en vorige stand herstellen mode: queued max: 20 triggers: - trigger: state entity_id: binary_sensor.voorbeeld_keuken_beweging to: "on" id: beweging - trigger: state entity_id: binary_sensor.voorbeeld_keuken_beweging to: "off" id: vrij - trigger: event event_type: timer.finished event_data: entity_id: timer.hs_keuken_licht_rust id: afgelopen - trigger: state entity_id: light.voorbeeld_keukenlamp id: licht_gewijzigd - trigger: state entity_id: input_boolean.hs_keuken_licht_auto to: "off" id: pauze - trigger: homeassistant event: start id: herstart - trigger: state entity_id: - binary_sensor.voorbeeld_keuken_beweging - light.voorbeeld_keukenlamp to: "unavailable" id: storing - trigger: state entity_id: - binary_sensor.voorbeeld_keuken_beweging - light.voorbeeld_keukenlamp to: "unknown" id: storing actions: - choose: - conditions: >- {{ trigger.id in ['pauze', 'herstart', 'storing'] or (trigger.id == 'licht_gewijzigd' and is_state('input_boolean.hs_keuken_licht_sessie', 'on') and trigger.to_state is not none and trigger.to_state.context.user_id is not none) }} sequence: - action: input_boolean.turn_off target: entity_id: input_boolean.hs_keuken_licht_auto - action: timer.cancel target: entity_id: timer.hs_keuken_licht_rust - action: input_boolean.turn_off target: entity_id: input_boolean.hs_keuken_licht_sessie - if: >- {{ state_attr('scene.hs_keuken_licht_voor_beweging', 'entity_id') is not none }} then: - action: scene.delete target: entity_id: scene.hs_keuken_licht_voor_beweging - conditions: >- {{ trigger.id == 'beweging' and is_state('input_boolean.hs_keuken_licht_auto', 'on') and is_state('binary_sensor.voorbeeld_keuken_beweging', 'on') and states('light.voorbeeld_keukenlamp') in ['on', 'off'] }} sequence: - action: timer.cancel target: entity_id: timer.hs_keuken_licht_rust - if: - condition: state entity_id: input_boolean.hs_keuken_licht_sessie state: "off" then: - action: scene.create data: scene_id: hs_keuken_licht_voor_beweging snapshot_entities: - light.voorbeeld_keukenlamp - action: input_boolean.turn_on target: entity_id: input_boolean.hs_keuken_licht_sessie - action: light.turn_on target: entity_id: light.voorbeeld_keukenlamp data: brightness_pct: 80 - conditions: >- {{ trigger.id == 'vrij' and is_state('input_boolean.hs_keuken_licht_auto', 'on') and is_state('input_boolean.hs_keuken_licht_sessie', 'on') and is_state('binary_sensor.voorbeeld_keuken_beweging', 'off') }} sequence: - action: timer.start target: entity_id: timer.hs_keuken_licht_rust data: duration: "00:05:00" - conditions: >- {{ trigger.id == 'afgelopen' and is_state('input_boolean.hs_keuken_licht_sessie', 'on') and not is_state('binary_sensor.voorbeeld_keuken_beweging', 'on') }} sequence: - choose: - conditions: >- {{ is_state('input_boolean.hs_keuken_licht_auto', 'on') and is_state('binary_sensor.voorbeeld_keuken_beweging', 'off') and states('light.voorbeeld_keukenlamp') in ['on', 'off'] and state_attr('scene.hs_keuken_licht_voor_beweging', 'entity_id') is not none }} sequence: - action: scene.turn_on target: entity_id: scene.hs_keuken_licht_voor_beweging default: - action: input_boolean.turn_off target: entity_id: input_boolean.hs_keuken_licht_auto - action: input_boolean.turn_off target: entity_id: input_boolean.hs_keuken_licht_sessie - if: >- {{ state_attr('scene.hs_keuken_licht_voor_beweging', 'entity_id') is not none }} then: - action: scene.delete target: entity_id: scene.hs_keuken_licht_voor_beweging