Is it possible to have an automation (not Node Red) that has a condition (someone is home) and then two actions but if the condition is not true (someone away) then only one of the actions is triggered?
Thanks.
Is it possible to have an automation (not Node Red) that has a condition (someone is home) and then two actions but if the condition is not true (someone away) then only one of the actions is triggered?
Thanks.
I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.
|
|
Thanks, will look into that.
I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.
I'd do that as two separate automations. The description is a bit vague though.
If / then actions would work with no conditions
Whats the trigger? Arrive home / leave home?
Whats the action?
I use groups
presence is performed on users being connected or disconnected from WiFi
groups.yaml
any_alarm_users_home:
# Will report 'Home' if any user Home, away if all users Away
name: "Any Alarm Users Home"
all: false
I use groups
presence is performed on users being connected or disconnected from WiFi
groups.yaml
any_alarm_users_home:
# Will report 'Home' if any user Home, away if all users Away
name: "Any Alarm Users Home"
all: false
icon: mdi:account-outline
entities:
- person.person1
- person.person2
all_alarm_users_home:
# Will report 'Away' if any user away, Home if all users Home
name: "all Alarm Users Home"
all: true
icon: mdi:account
entities:
- person.person1
- person.person2
Then the following automatons: automation.yaml
- alias: "Alarm, 'arm alarm' when everyone left"
id: '42575320-5d8e-4223-8f6f-a83f1c2a77a4'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "not_home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_arm_away
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id:
- alarm_control_panel.intrusion_alarm
- alarm_control_panel.wellington_mode
- alias: "Alarm, 'disarm alarm' when anyone home, homekit disarm"
id: '962edbd8-70c0-4998-9ce5-de50045b007d'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_disarm
action:
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.intrusion_alarm
data:
code: !secret disarm_code
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.wellington_mode
I use groups
presence is performed on users being connected or disconnected from WiFi
groups.yaml
any_alarm_users_home:
# Will report 'Home' if any user Home, away if all users Away
name: "Any Alarm Users Home"
all: false
icon: mdi:account-outline
entities:
- person.person1
- person.person2
all_alarm_users_home:
# Will report 'Away' if any user away, Home if all users Home
name: "all Alarm Users Home"
all: true
icon: mdi:account
entities:
- person.person1
- person.person2
Then the following automatons: automation.yaml
- alias: "Alarm, 'arm alarm' when everyone left"
id: '42575320-5d8e-4223-8f6f-a83f1c2a77a4'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "not_home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_arm_away
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id:
- alarm_control_panel.intrusion_alarm
- alarm_control_panel.wellington_mode
- alias: "Alarm, 'disarm alarm' when anyone home, homekit disarm"
id: '962edbd8-70c0-4998-9ce5-de50045b007d'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_disarm
action:
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.intrusion_alarm
data:
code: !secret disarm_code
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.wellington_mode
icon: mdi:account-outline
entities:
- person.person1
- person.person2
all_alarm_users_home:
# Will report 'Away' if any user away, Home if all users Home
name: "all Alarm Users Home"
all: true
icon: mdi:account
entities:
- person.person1
- person.person2
Then the following automatons: automation.yaml
- alias: "Alarm, 'arm alarm' when everyone left"
id: '42575320-5d8e-4223-8f6f-a83f1c2a77a4'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "not_home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_arm_away
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id:
- alarm_control_panel.intrusion_alarm
- alarm_control_panel.wellington_mode
- alias: "Alarm, 'disarm alarm' when anyone home, homekit disarm"
id: '962edbd8-70c0-4998-9ce5-de50045b007d'
trigger:
- platform: state
entity_id: group.any_alarm_users_home
to: "home"
- platform: event
event_type: homekit_state_change
event_data:
entity_id: alarm_control_panel.intrusion_alarm
service: alarm_disarm
action:
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.intrusion_alarm
data:
code: !secret disarm_code
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.wellington_mode
Trigger is a temperature change.
Condition is a person home. so, person home then do actions 1 and 2.
Person not home, then only do action 1.
I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.
|
|