Toggle groups too when inside entities groups (subgroup) toggle

Yes, but if a second entity turns on in any of the nested groups, it does not cause a state change on the top level group, which is what I believe he is seeing.

thats correct, on is on, it has to turn_off before it can turn on again.

don’t think that can ever change.
If poster wants to record the last changed motion sensors, he should use another tool.

I have an ApDaemon app for that, or use the custom integration ‘variable’ …

Yes I agree, is not my trouble.
The state of a group is on if one of is entity is on (unless all flag), unfortunatly if the entity on is an another group the mean group is not on.

ex:

group1:
entities:
-sensor1

group2:
entities:
- group 1

If sensor1 state is on, group1 state will be on but group2 state off…

No no, I look for if any of the entities in the nested groups turn on, that groups turns on. If the nested group turns on, it turns on the parent group. like Mariusthvdb describe.
So It may be a bug or a mistake in my configuration ?

yes indeed:

  alarm_sensors:
    name: Alarm detectors
    entities:
      - groups.occupancy_sensors

should be group, not groups

:man_facepalming: :man_facepalming: :man_facepalming: :man_facepalming:

You got it!

thank you.

I close my feature that already works :clap: