Binary Sensor Yaml configuration

Hi everyone,
first of all sorry if this has been asked a hundred times. i am very new to all this and really struggle to get my head around some of the different bits especially the configuring the yaml file after trying to add something.

i am trying to add a binary sensor for my front door using this code

binary_sensor:
  - plaform: mqtt
    name: "Front Door Sensor"
    state_topic: "tele/RF_Bridge/RESULT"   
    value_template: '{{value_jason.RfReceived.Data}}
    payload_on: "2DC70E"
    payload_off: "2DC70A"
    device_class: door
    optimistic: false
    qos: 1
    retain: false

but no matter how much i try and sort this i get the same message time after time.

Configuration invalid
CHECK CONFIG
Invalid config for [binary_sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 52). Please check the docs at https://home-assistant.io/components/binary_sensor/
Integration not found: switches

if anyone could help me it would be greatly appreciated.

many thanks
Tom

OK…

when you tried to post your entry did you get a warning that said something like “you are trying to post code that isn’t formatted correctly” and it asked you to check it again?

The reason I ask is that there is supposed to be a new feature to warn new people to make sure they post their code correctly formatted. Either feature isn’t working or you clicked to ignore it.

Either way you will need to edit your post to properly format your code. We can’t see syntax errors if you don’t and we can’t help you.

thank you for that I wasn’t sure what it was wanting from me. So that’s a good start from me, i hope this is OK now? i followed your instructions.

You misspelled platform

At first glance that all looks OK.

the log says something about “switches” integration not being found.

I believe you have some other indentation or spelling error in your config related to the “switch:” entry. Check that first. It should be “switch:” not “switches:”. If you can’t locate it then you should probably post your entire configuration.yaml file with all of your personal/sensitive info removed.

good catch! I completely missed it.

Thank you both very much, not like am dyslexic eyes to let me down with my spelling. couldn’t see the wood for the trees :joy::rofl::joy:

This is my yaml file at the moment i know its not pretty and very basic.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Sensors
sensor:
  # Weather prediction
  - platform: yr

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
    
mqtt:
 broker: core-mosquitto
 username: xxxxxx
 password: xxxxx

switch:
  - platform: mqtt
    name: "Front Outdoor Lights"
    state_topic: "stat/Front_Outdoor_Lights/POWER"
    command_topic: "cmnd/Front_Outdoor_Lights/power"
    payload_on: "ON"
    payload_off: "OFF"
    qos: 1
    
  - platform: mqtt
    name: "Kitchen Light"
    command_topic: "cmnd/Kitchen/Kitchen_Light/power"
    state_topic: "stat/Kitchen_Light/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    
  - platform: mqtt
    name: "Dinning Romm Light"
    state_topic: "stat/Dinning_Room_Light/POWER"
    command_topic: "cmnd/Dinning_Room_Light/power"
    payload_on: "ON"
    payload_off: "OFF"
    qos: 1

binary_sensor:
  - platform: mqtt
    name: "Front Door Sensor"
    state_topic: "tele/RF_Bridge/RESULT"   
    value_template: '{{value_jason.RfReceived.Data}}'
    payload_on: "2DC70E"
    payload_off: "2DC70A"
    device_class: door
    optimistic: false
    qos: 1
    retain: false

Is it still not working or is everything OK now?

Finity
i have made the changes and restarted, i have a notification popping up saying.

your confg contains extra keys that platform does not support (but were silently accepted before 0.88).
please find and remove the following this will become a breaking change.

[optimistic], [retain]. (see/config/configuration.yaml, line 52).
offending data: {“platform”: “mqtt”, “name”, “front door sensor”,
“state_topic”, “tele/RF_bridge/RESULT”, “value_template”,
“”, “payload_on”, “”, “payload_off”,
“”, “device_class”, “”, “optimistic” :false,
“qos” “”, “retain”: false}

i have checked with the Configuration validation tool and it says its all fine now. But its got a issue with it still.

The only thing the validation tool checks for is syntax.

Your issue is with the use of “optimistic” in the config as it’s not longer acceptable to have attributes assigned that don’t work. That’s what it’s telling you. Remove the optimistic from the binary sensor

flamingm0e,
i have been through and removed the optimistic line and from what you have said i removed the retain line as well. i rebooted and there’s no more issues. i just need to figure out how to make it visual on the front end now so it shows up.
i assume i can just create a card to do this?

What about

value_template: '{{value_json.RfReceived.Data}}'

instead of

?

Yes. Just create a card

is this asking for my mqtt log in details or something complacently different as i am getting this as a new notification???

Invalid config for [switch.mqtt]: required key not provided @ data[‘command_topic’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.mqtt/

# Sensors
sensor:
  # Weather prediction
  - platform: yr

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
    
mqtt:
 broker: core-mosquitto
 username: xxx
 password: xxx

switch:

  - platform: mqtt
    name: "Front Outdoor Lights"
    state_topic: "stat/Front_Outdoor_Lights/POWER"
    command_topic: "cmnd/Front_Outdoor_Lights/power"
    payload_on: "ON"
    payload_off: "OFF"
    qos: 1
    
  - platform: mqtt
    name: "Kitchen Light"
    state_topic: "home/Kitchen_Light/switch1"
    command_topic: "home/Kitchen_Light/switch1/set"
    availability_topic: "home/Kitchen_Light/switch1/available"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    
  - platform: mqtt
    name: "Dinning Romm Light"
    state_topic: "home/Dinning_Room_Light/switch1"
    command_topic: "home/Dinning_Room_Light/switch1/set"
    availability_topic: "home/Dinning_Room_Light/switch1/available"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    qos: 1
    
  - platform: mqtt
    name: "Hall Light"
    state_topic: "home/Hall_Light/switch1"
    comand_topic: "home/Hall_Light/switch1/set"
    availability_topic: "home/Hall_Light/switch1/available"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    qos: 1

binary_sensor:
  - platform: mqtt
    name: "Front Door Sensor"
    state_topic: "tele/RF_Bridge/RESULT"   
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "2DC70E"
    payload_off: "2DC70A"
    device_class: door
    qos: 1

Yet again…

No

Sorry i can only apologise for my spelling AGAIN.
OK any thoughts on what its wanting me to provided then? as i have managed to get 3 of the switches up on a card but cant get the newest hall light up there and working as far as i can see there all the same so stumped as to why this would be???

Huh?

What error message are you referring to?

I get this message and i know you said it only checks the syntax but i cant see the switch on the front end to use in a card.

Did you actually change the spelling error pointed out by @flamingm0e in the last switch configuration?