Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,20 @@
- trigger: state
entity_id:
- input_boolean.away_mode
- trigger: state
entity_id:
- input_boolean.visitors
Comment on lines 484 to +489
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The triggers for away_mode and visitors can be combined into a single state trigger with multiple entities. This is more concise and follows Home Assistant best practices for maintainability.

  - trigger: state
    entity_id:
    - input_boolean.away_mode
    - input_boolean.visitors

conditions: []
actions:
- if:
- condition: state
entity_id: input_boolean.away_mode
state:
- 'on'
- condition: state
entity_id: input_boolean.visitors
state:
- 'off'
then:
- action: switch.turn_off
metadata: {}
Expand All @@ -511,13 +518,20 @@
- trigger: state
entity_id:
- input_boolean.away_mode
- trigger: state
entity_id:
- input_boolean.visitors
Comment on lines 518 to +523
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the previous automation, these triggers can be merged into a single state trigger to reduce redundancy.

  - trigger: state
    entity_id:
    - input_boolean.away_mode
    - input_boolean.visitors

conditions: []
actions:
- if:
- condition: state
entity_id: input_boolean.away_mode
state:
- 'on'
- condition: state
entity_id: input_boolean.visitors
state:
- 'off'
then:
- action: switch.turn_on
metadata: {}
Expand Down
3 changes: 3 additions & 0 deletions automations/away_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@
- condition: state
entity_id: input_boolean.away_mode
state: "on"
- condition: state
entity_id: input_boolean.visitors
state: "off"
- condition: and
conditions:
- condition: numeric_state
Expand Down
10 changes: 10 additions & 0 deletions automations/visitors.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
not run if `input_boolean.visitors` is `on`.
* [**Presence simulation Aurore's bedroom**](away_mode.yaml#L411): This
automation will not run if `input_boolean.visitors` is `on`.
* [**Garage: Turn off power if user moves away after pre-arrival**](away_mode.yaml#L611):
This automation will not run if `input_boolean.visitors` is `on`.

The following automations from the [`automations.yaml`](../automations.yaml) file are

Check notice on line 38 in automations/visitors.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

automations/visitors.md#L38

Expected: 80; Actual: 85
impacted by the `input_boolean.visitors` value:

* [**Block the garage door when we are away**](../automations.yaml): This automation
will keep the garage power ON if `input_boolean.visitors` is `on`.
* [**Turn on/off camera when we are away**](../automations.yaml): This automation
will keep the camera sirens and notifications OFF if `input_boolean.visitors` is `on`.

Check notice on line 44 in automations/visitors.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

automations/visitors.md#L44

Expected: 80; Actual: 88

## Vacuum Cleaner Automations

Expand Down