thank you.
Is there a way to adapt this kind of code :
{{ states | selectattr('entity_id','in', ['binary_sensor.kitchen_occupied','binary_sensor.living_room_occupied','binary_sensor.conservatory_occupied', 'binary_sensor.upstairs_hall_occupied', 'binary_sensor.bathroom_occupied','binary_sensor.bedroom_occupied'] ) |selectattr('state','eq','on') | list | count }}
without listing all entities needed.