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

1757 posts

Uber Geek


#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.


Filter this topic showing only the reply marked as answer Create new topic
eluSiveNZ
180 posts

Master Geek


  #3169917 9-Dec-2023 11:33
Send private message

Have a look at the “Choose” action.
It allows for multiple condition to action based automations.
You might need to adjust or remove your main condition to get this to work correctly.

 
 
 

You will find anything you want at MightyApe (affiliate link).
peejayw

1757 posts

Uber Geek


  #3169965 9-Dec-2023 13:28
Send private message

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.


timmmay
19757 posts

Uber Geek

Trusted
Lifetime subscriber

  #3170028 9-Dec-2023 15:58
Send private message

I'd do that as two separate automations. The description is a bit vague though.




SpookyAwol
612 posts

Ultimate Geek


  #3170374 10-Dec-2023 16:59
Send private message

If / then actions would work with no conditions


SpookyAwol
612 posts

Ultimate Geek


  #3170377 10-Dec-2023 17:05
Send private message

Whats the trigger? Arrive home / leave home?

 

Whats the action?

 

  • If person 1 + 2 are home, then 2 actions
  • If person 1 not 2 home then action 1
  • If person 2 not 1 home then action 2

  #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

 


peejayw

1757 posts

Uber Geek


  #3170752 11-Dec-2023 15:55
Send private message

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.


Filter this topic showing only the reply marked as answer Create new topic





News and reviews »

One New Zealand Extends 3G Switch-off Date
Posted 11-Apr-2024 08:56


Amazon Echo Hub Review
Posted 10-Apr-2024 18:57


Epson Launches New Versatile A4 Desktop Scanners
Posted 10-Apr-2024 15:31


Motorola Mobility Launches New Android Phones in New Zealand
Posted 10-Apr-2024 14:59


Logitech G Unveils the PRO X 60 Gaming Keyboard
Posted 9-Apr-2024 19:01


Logitech Unveils Signature Slim Keyboard and Combo
Posted 9-Apr-2024 13:33


ExpressVPN Launches Aircove Go Portable Router With Built-in VPN
Posted 26-Mar-2024 21:25


Shure MoveMic Review
Posted 25-Mar-2024 12:47


reMarkable 2 Launches at JB Hi-Fi New Zealand
Posted 20-Mar-2024 08:36


Samsung Galaxy S24 Ultra review
Posted 19-Mar-2024 11:37


Google Nest Wifi Pro Review
Posted 16-Mar-2024 11:28


Samsung Galaxy A55 5G and Galaxy A35 5G
Posted 12-Mar-2024 12:41


Cricut EasyPress Mini Zen Blue launches at Spotlight New Zealand
Posted 12-Mar-2024 12:32


Logitech Introduces MX Brio Webcam
Posted 12-Mar-2024 12:24


HP Unveils Broadest Consumer Portfolio of AI-Enhanced Laptops
Posted 3-Mar-2024 18:09









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.







GoodSync is the easiest file sync and backup for Windows and Mac