Integration error: switches - Integration 'switches' not found

Hi Group i am new to all of this an trying to do e light a count.
the lights are not smart just the switches.
I currently have the config like this.

but i am getting this error Integration error: switches - Integration ‘switches’ not found

can someone point me in the right direction?

image

It kind of tells you right there.

you used “switches:” when it should be “switch:”

However that won’t solve the problem either because a switch is a device that is either on or off. you are trying to count how many lights are on. For that you need a sensor.

so change “switches:” to “sensor:”

also you didn’t indent the “unit_of_measurement” and everything below it far enough.

BUT…

if you already have a “sensor:” entry in your configuration.yaml then you can add that because it will only allow one “sensor:” entry in that location.

If that’s the case the just add the template portion under the existing “sensor:” entry like:

sensor:
  - your existing sensors
  
  - platform: template
    sensors:
      number_of_lights_on:
        etc
        etc

also realize you are using the legacy template sensor syntax instead of the modern template syntax. It’s not really a big deal as both still work but someone I’m sure will come along telling you to change it to the other syntax so I figured I’d beat them to the punch. :grinning_face_with_smiling_eyes:

lastly you should not post screen shots of the code. please use code blocks by copying the text and using three backticks on the line before and after the text. It allows others to just copy your code and edit it as needed without having to write it all out from scratch.

Hi,

ok Thank you appreciate your input, where can i read more about the modern template syntax?

everything “modern” is in the beginning.

the legacy stuff is further down.

But again just to be clear the legacy stuff still works and should continue to work. I use it extensively.

It just won’t get feature updates. But I don’t find that a detriment if the existing sensor works as desired.

Thank you

why is it that when i click on check config in developer tools it keep checking the file for ever and never stops?

It’s hard to know from the outside.

Maybe it’s an error that it’s struggling with or the system itself is struggling to complete the check.

post you new config so we can look at it for potential issues.