Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


peejayw

1913 posts

Uber Geek
+1 received by user: 123


#311034 9-Dec-2023 10:31
Send private message

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.


Create new topic

This is a filtered page: currently showing replies marked as answers. Click here to see full discussion.

fearandloathing
537 posts

Ultimate Geek
+1 received by user: 206

ID Verified
Lifetime subscriber

  #3170380 10-Dec-2023 17:35
Send private message

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

 


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.