Groups & automations

I know this is a pretty basic question, but couldn’t really find a definitive answer.

I setup a group called all_devices which has iphones, ipads, etc. Now, if i setup an automation either with triggers or conditions based on that group, will it only fire if all of those devices meet the criteria or only 1 of the group. For example, i would like to set the lights to turn on if any of the devices are home so would i be able to use the all_devices group?

I can confirm that when I have three devices in a group called Joe and one of them is away and the other two are listed as home my group, Joe, is listed as home. Logically the group functions as an “or” operation.

Joe:
 - Phone
 - Laptop 
 - Desktop

For the group “Joe” to be not_home all devices must be away. If “Phone” or “Laptop” or “Desktop” are Home then the group “Joe” would be state Home.

Ok thank you for that. I will write my automations based on that!

If you want an automation based on that all devices should have the same state you need to combine with a condition like:

condition:
  - platform: state
    entity_id: group.all_devices
    state: "home"

so you are saying that it is not considered an “or” statement? based on that condition you put, every single device needs to be “home” in order for the trigger to occur?

Correct. With the condition, every device need to be “home” for the automation to trigger.