Template Binary Sensor getting config error

No matter how I arrange this, I keep getting an error.

binary_sensor:
  - platform: template
    sensor:
      Bathroom_Fan: 
        friendly_name: "2nd BATHROOM FAN motion"
        delay_off:
          minutes: 2
        value_template: "{{ is_state('sensor.ge_26931_smart_motion_switch_burglar_5', '8') }}"

Discover some devices automatically

discovery:

# Sensors
sensor:
  # Weather prediction
  - platform: yr
  - platform: random
  #- platform: template
  # Motion
  #- plateform:  state

I get more errors if I UNcomment -platform: template

Thx

First problem I see, the syntax is incorrect. Look at the docs closely.

    sensor:

This map key should be the plural sensors not sensor.

Second problem I see is the naming of the entity, no capital letters are allowed. See the configuration troubleshooting docs.

      Bathroom_Fan:

This should be bathroom_fan. Personally, I’d call it bathroom_fan_motion. :slight_smile:

The rest of it looks OK to me, but you’ll have to fix those problems and try again. I would also suggest adding device_class: motion, like in this example (though I’m noticing that example code is not great because the sensor entity name is in all caps…). It gives you an appropriate icon and changes the color and icon depending on the sensor state.

All the example code blocks have a “Copy” button, so it’s convenient to copy the code, paste it into your config, then modify the relevant parts. Less likely to make an error that way.

Another suggestion, it also helps to include any of the error messages you see along with you post.

Holy crap! That worked, I no longer get an error!!

Thanks!

Which button do I “reload”?
“Core, Groups, or Scipts”

Fan still turns off after like 15 seconds and I have it set to 2 min?

Ha! that’s great…

I told you the same thing in the PM you sent me two days ago.

I don’t mind helping but I don’t think it will be thru PM any more. You keep jumping back & forth between topics and confusing the issues with different code from those topics without specifying when you switch.

I think if you put everything in one thread it will be easier for you (and us) to keep track of what we are trying to help you with at the time.

But on the other hand you are going to have to start figuring this stuff out on your own. you keep asking the same questions over and over again and I keep giving you the same answers over and over again.

Do you even leave your RPi on all the time yet or do you still not even trust HA to run securely on your network for extended periods of time?

Well, I appreciate the help.

I do read the material, but when I saw examples with only one “s” (sensor)I figured I was doing it right.

I have been leaving the RPI on but I don’t think its secure?

can you point me to the location in the official documentation where it has that example?

if it’s in there it needs fixed.

I’m looking for the example I copy/pasted