How to create a group

Im totally frustrated trying to create groups. Its not HA, its the lack of knowledge I have to edit and configure a configuration yaml file properly.
Im new with HA, I have a very simple configuration file and Im trying to create a new sensor group for my attic light.
I have 2 sensors, one downstairs and one upstairs, all I want to do is create a group where if both sensors stop detecting motion to turn off. I noticed the other day that if the first sensor detects motion and not the second sensor the light remained on all night.
This is my simple configuration file: see attached file

Configuration File screen shot

When I check the configuration I get : Configuration invalidCHECK CONFIGURATION

Integration error: Lights - Integration ‘Lights’ not found.

Im not using HACS, Im not using lovelace, nothing, very simple setup.
What am I doing wrong, what is missing.

Any help would be greatly appreciated, thanks

That is not coming from the configuration you are showing, I guess you had “Lights:” before “Luz:” (which is also wrong).

Correct syntax for groups is very well documented.

Motions sensors are binary_sensors, as they report motion or no motion. So it cannot be sensor.sonos_motion_detection_2_power.

To group binary sensors, use the appropriate Binary Sensor Group.

How is that even possible?

  • A Light Group is for making a collection of lights appear as a single light.

  • A Group is more generalized and is for making a collection of various types of entities.

You tried to create a Light Group containing sensors and that’s invalid. Create a Group containing the sensors.

You also commented out the line containing the light: option. You probably don’t have it defined anywhere else because the error message indicates “Integration error: Lights - Integration ‘Lights’ not found.”

The line you commented out is odd because it tells Home Assistant to look for light information in the configuration.yaml file but that’s the file that line is already in.

There is no option named Luz so I don’t know why you put that there. In addition, options are always lowercase but the first letter in Luz is uppercase.

Ok great, as I said earlier Im new in HA so obviously Im making a lot of mistakes that I dont know of.

That makes totally sense now. Im going to try to use the binary sensor group now.