- id: button_huiskamer_pressed alias: Button huiskamer pressed triggers: trigger: device device_id: 9b88e5cced0fd2c39b6e5d08beafe7e8 domain: hue type: short_release subtype: 1 actions: - action: light.turn_off entity_id: - light.huiskamer - light.kerstverlichting - action: input_boolean.turn_off target: entity_id: input_boolean.matrix_display - action: climate.set_temperature target: entity_id: climate.thermostat data: temperature: 18 - choose: conditions: condition: state entity_id: media_player.55pus6704_12 state: 'on' sequence: action: remote.send_command data: entity_id: remote.55pus6704_12 command: PowerOff - id: doorbell_pressed_detection alias: Doorbell pressed detection triggers: trigger: state entity_id: binary_sensor.ring_doorbell_ding to: 'on' actions: - parallel: - sequence: - variables: snapshot_id: '{{ range(10000, 99999) | random }}' snapshot_date: '{{ now().strftime(''%Y-%m-%d_%H-%M-%S'') }}' snapshot_filename: snapshot_{{ snapshot_date }}_id-{{ snapshot_id }}.jpg snapshot_path_external: secret path_doorbell_snapshot_external snapshot_path_internal: secret path_doorbell_snapshot_internal snapshot_location_external: '{{ snapshot_path_external }}{{ snapshot_filename }}' snapshot_location_internal: '{{ snapshot_path_internal }}{{ snapshot_filename }}' - action: camera.snapshot data: filename: '{{ snapshot_location_internal }}' target: entity_id: camera.ring_doorbell - delay: seconds: 10 - action: camera.snapshot data: filename: '{{ snapshot_location_internal }}' target: entity_id: camera.ring_doorbell - action: input_text.set_value data: entity_id: input_text.doorbell_snapshot_location value: '{{ snapshot_location_external }}' - delay: seconds: 5 - action: switch.turn_off target: entity_id: switch.ring_doorbell_live_stream - action: shell_command.remove_old_files data: days_to_keep: 30 path: '{{ snapshot_path_internal }}' - sequence: - condition: '{{ states("sensor.parkeerplaats_motion_sensor_illuminance") | float(default=0) < 5 }}' - action: script.scene_voordeur_motion - action: input_boolean.turn_on target: entity_id: input_boolean.automation_motion_voordeur_triggered - id: doorbell_unpressed_detection alias: Doorbell unpressed detection triggers: trigger: state entity_id: binary_sensor.ring_doorbell_ding to: 'off' for: minutes: 5 conditions: condition: state entity_id: input_boolean.automation_motion_voordeur_triggered state: 'on' actions: - action: light.turn_off entity_id: light.voordeur - action: input_boolean.turn_off target: entity_id: input_boolean.automation_motion_voordeur_triggered - id: hourly_gas_calculation alias: Hourly gas calculation triggers: - trigger: state entity_id: sensor.gas_meter_gas_consumption - trigger: time_pattern minutes: /5 actions: - choose: - conditions: "{{\n states(\"sensor.gas_meter_gas_consumption\") == states(\"\ input_text.gas_meter_gas_consumption_previous\")\n and now() - states('input_text.hourly_gas_calculation_last_triggered')\ \ | as_datetime > timedelta(seconds=299)\n}}\n" sequence: action: input_number.set_value target: entity_id: input_number.hourly_gas data: value: 0 - conditions: '{{ states("sensor.gas_meter_gas_consumption") != states("input_text.gas_meter_gas_consumption_previous") }}' sequence: - action: input_number.set_value target: entity_id: input_number.hourly_gas data: value: '{{ (states("sensor.gas_meter_gas_consumption") | float - states("input_text.gas_meter_gas_consumption_previous") | float) | multiply(12) | round(3) }}' - action: input_text.set_value target: entity_id: input_text.gas_meter_gas_consumption_previous data: value: '{{ states("sensor.gas_meter_gas_consumption") }}' - action: input_text.set_value target: entity_id: input_text.hourly_gas_calculation_last_triggered data: value: '{{ state_attr("automation.hourly_gas_calculation", "last_triggered") }}' - id: matrix_panel_update alias: Matrix panel update mode: restart triggers: trigger: state entity_id: - input_boolean.matrix_display - input_number.matrix_brightness - input_select.matrix_view - sensor.matrix_temperature_outside - sensor.matrix_temperature_inside - sensor.matrix_inverter_outputpower - sensor.matrix_inverter_daytotal - sensor.matrix_usage_dayenery - sensor.matrix_usage_daygas actions: choose: - conditions: condition: numeric_state entity_id: input_number.matrix_brightness below: 1 sequence: - action: input_boolean.turn_off target: entity_id: input_boolean.matrix_display - action: input_number.set_value target: entity_id: input_number.matrix_brightness data: value: 100 - conditions: condition: not conditions: - condition: state entity_id: input_boolean.matrix_display state: 'off' for: minutes: 1 - condition: state entity_id: device_tracker.matrix_wifi state: not_home sequence: action: rest_command.matrix data: display: '{{ states("input_boolean.matrix_display") }}' brightness: '{{ states("input_number.matrix_brightness") }}' view: '{{ states("input_select.matrix_view") }}' temperature_outside: '{{ states("sensor.matrix_temperature_outside") }}' temperature_inside: '{{ states("sensor.matrix_temperature_inside") }}' inverter_outputpower: '{{ states("sensor.matrix_inverter_outputpower") }}' inverter_daytotal: '{{ states("sensor.matrix_inverter_daytotal") }}' usage_dayenery: '{{ states("sensor.matrix_usage_dayenery") }}' usage_daygas: '{{ states("sensor.matrix_usage_daygas") }}' - id: matrix_panel_cycle alias: Matrix panel cycle views triggers: trigger: time_pattern seconds: /15 conditions: condition: state entity_id: input_boolean.matrix_display state: 'on' actions: action: input_select.select_next target: entity_id: input_select.matrix_view - id: matrix_panel_activation alias: Matrix panel activation triggers: trigger: state entity_id: group.motion_huiskamer to: 'on' conditions: condition: and conditions: - condition: state entity_id: input_boolean.matrix_display state: 'off' - condition: state entity_id: device_tracker.matrix_wifi state: home actions: action: input_boolean.turn_on target: entity_id: input_boolean.matrix_display - id: matrix_panel_deactivation alias: Matrix panel deactivation triggers: trigger: state entity_id: group.motion_huiskamer to: 'off' for: minutes: 15 conditions: condition: state entity_id: input_boolean.matrix_display state: 'on' actions: action: input_boolean.turn_off target: entity_id: input_boolean.matrix_display - id: motion_huiskamer_detected alias: Motion huiskamer detected triggers: trigger: state entity_id: group.motion_huiskamer to: 'on' conditions: - condition: state entity_id: light.huiskamer state: 'off' - condition: numeric_state entity_id: sensor.huiskamer_motion_sensor_1_illuminance below: 1 - condition: numeric_state entity_id: sensor.huiskamer_motion_sensor_2_illuminance below: 1 actions: action: script.scene_huiskamer_motion - id: motion_huiskamer_undetected alias: Motion huiskamer undetected triggers: trigger: state entity_id: binary_sensor.presence_huiskamer to: 'off' for: minutes: 1 conditions: condition: state entity_id: light.huiskamer state: 'on' actions: action: light.turn_off entity_id: light.huiskamer - id: motion_parkeerplaats_detected alias: Motion parkeerplaats detected triggers: trigger: state entity_id: binary_sensor.parkeerplaats_motion_sensor_motion to: 'on' conditions: condition: and conditions: - condition: state entity_id: light.parkeerplaats state: 'off' - condition: numeric_state entity_id: sensor.parkeerplaats_motion_sensor_illuminance below: 5 actions: - action: script.scene_parkeerplaats_motion - action: input_boolean.turn_on target: entity_id: input_boolean.automation_motion_parkeerplaats_triggered - id: motion_parkeerplaats_undetected alias: Motion parkeerplaats undetected triggers: trigger: state entity_id: binary_sensor.parkeerplaats_motion_sensor_motion to: 'off' for: minutes: 1 conditions: condition: state entity_id: input_boolean.automation_motion_parkeerplaats_triggered state: 'on' actions: - action: light.turn_off entity_id: light.parkeerplaats - action: input_boolean.turn_off target: entity_id: input_boolean.automation_motion_parkeerplaats_triggered - id: motion_toilet_detected alias: Motion toilet detected triggers: trigger: state entity_id: binary_sensor.toilet_motion_sensor_motion to: 'on' conditions: condition: state entity_id: light.toilet state: 'off' actions: action: script.scene_toilet_motion - id: motion_toilet_undetected alias: Motion toilet undetected triggers: trigger: state entity_id: binary_sensor.toilet_motion_sensor_motion to: 'off' for: minutes: 1 conditions: condition: state entity_id: light.toilet state: 'on' actions: action: light.turn_off entity_id: light.toilet - id: motion_tuin_detected alias: Motion tuin detected triggers: trigger: state entity_id: group.motion_tuin to: 'on' conditions: condition: and conditions: - condition: state entity_id: light.achterdeur state: 'off' - condition: state entity_id: light.schuur state: 'off' - condition: or conditions: - condition: numeric_state entity_id: sensor.tuin_motion_sensor_1_illuminance below: 5 - condition: numeric_state entity_id: sensor.tuin_motion_sensor_2_illuminance below: 5 actions: - action: script.scene_tuin_motion - action: input_boolean.turn_on target: entity_id: input_boolean.automation_motion_tuin_triggered - id: motion_tuin_undetected alias: Motion tuin undetected triggers: trigger: state entity_id: group.motion_tuin to: 'off' for: minutes: 1 conditions: condition: state entity_id: input_boolean.automation_motion_tuin_triggered state: 'on' actions: - action: light.turn_off entity_id: - light.achterdeur - light.schuur - action: input_boolean.turn_off target: entity_id: input_boolean.automation_motion_tuin_triggered - id: remote_huiskamer_pressed alias: Remote huiskamer pressed mode: restart triggers: trigger: event event_type: hue_event conditions: "{{\n trigger.event.data.id == \"afstandsbediening_1_button\"\n and\ \ (\n trigger.event.data.type == \"short_release\"\n or trigger.event.data.type\ \ == \"repeat\"\n )\n}}\n" actions: choose: - conditions: "{{\n trigger.event.data.subtype == 1\n and trigger.event.data.type\ \ == \"repeat\"\n}}\n" sequence: action: script.scene_huiskamer_tvkijken - conditions: '{{ trigger.event.data.type == "short_release" }}' sequence: choose: - conditions: '{{ trigger.event.data.subtype == 1 }}' sequence: choose: - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_spelen sequence: action: script.scene_huiskamer_overdag - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_overdag sequence: action: script.scene_huiskamer_avond - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_avond sequence: action: script.scene_huiskamer_eten - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_eten sequence: action: script.scene_huiskamer_koken - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_koken sequence: action: script.scene_huiskamer_tvkijken - conditions: condition: state entity_id: input_text.scene_huiskamer_last_triggered state: scene_huiskamer_tvkijken sequence: action: script.scene_huiskamer_spelen - conditions: '{{ trigger.event.data.subtype == 2 }}' sequence: action: script.scene_huiskamer_brighter - conditions: '{{ trigger.event.data.subtype == 3 }}' sequence: action: script.scene_huiskamer_dimmer - conditions: '{{ trigger.event.data.subtype == 4 }}' sequence: action: script.scene_huiskamer_off - id: remote_kerstboom_pressed alias: Remote kerstboom pressed mode: restart triggers: trigger: event event_type: hue_event conditions: "{{\n trigger.event.data.id == \"afstandsbediening_2_button\"\n and\ \ (\n trigger.event.data.type == \"short_release\"\n or trigger.event.data.type\ \ == \"long_release\"\n )\n}}\n" variables: light_entity: "{% if trigger.event.data.type == \"short_release\" %}\n light.twinkly_strings\n\ {% else %}\n light.twinkly_icicle\n{% endif %}\n" actions: choose: - conditions: '{{ trigger.event.data.subtype == 1 }}' sequence: action: light.turn_on data_template: entity_id: '{{ light_entity }}' - conditions: '{{ trigger.event.data.subtype == 2 }}' sequence: action: light.turn_on data_template: entity_id: '{{ light_entity }}' brightness_step_pct: 20 - conditions: '{{ trigger.event.data.subtype == 3 }}' sequence: action: light.turn_on data_template: entity_id: '{{ light_entity }}' brightness_step_pct: -20 - conditions: '{{ trigger.event.data.subtype == 4 }}' sequence: action: light.turn_off data_template: entity_id: '{{ light_entity }}' - id: router_mesh_points_activation alias: Router mesh points activation triggers: trigger: state entity_id: group.all_persons to: home actions: action: switch.turn_on data: entity_id: - switch.wifi_mesh_boven_socket - switch.wifi_mesh_tuin_socket - id: router_mesh_points_deactivation alias: Router mesh points deactivation triggers: trigger: state entity_id: group.all_persons to: not_home for: minutes: 15 actions: action: switch.turn_off data: entity_id: - switch.wifi_mesh_boven_socket - switch.wifi_mesh_tuin_socket - id: vacation_mode alias: Vacation mode mode: single max_exceeded: silent triggers: - trigger: state entity_id: sensor.light_buiten - trigger: time_pattern minutes: /5 actions: choose: conditions: condition: and conditions: - condition: numeric_state entity_id: sensor.light_buiten below: 100 - condition: time after: 07:00:00 before: '22:30:00' sequence: - delay: seconds: '{{ range(0, 5*60+1) | random }}' - action: script.scene_huiskamer_tvkijken default: - delay: seconds: '{{ range(0, 5*60+1) | random }}' - action: light.turn_off entity_id: light.huiskamer - id: vacation_mode_activation alias: Vacation mode activation mode: single triggers: trigger: state entity_id: group.all_persons to: not_home for: hours: 24 actions: action: homeassistant.turn_on entity_id: automation.vacation_mode - id: vacation_mode_deactivation alias: Vacation mode deactivation mode: single triggers: trigger: state entity_id: group.all_persons to: home actions: action: homeassistant.turn_off entity_id: automation.vacation_mode