Binary_sensor.yaml property error

I ma getting a Property platfrom is not allowed. when trying to add to the binary_sensor.yaml file.

If I add:

binary_sensor:
  - platform: hikvision
    host: IP_ADDRESS
    username: user
    password: pass

to the configuration.yaml file it will accept it.

But if I create a binary_senor.yaml file and link to configutation.yaml with

binary_sensor: !include binary_sensor.yaml

and add this to the binary_sensor.yaml file

 - platform: hikvision
   host: IP_ADDRESS
   username: user
   password: pass

I get the error message posted above.

Any assistance appreciated. TIA.

In vscode? Just ignore it, it’s a bug.

1 Like

I’m guessing here, but are you by any chance using the Studio Code Server to edit your configuration files (including binary_sensor.yaml)?

If so, there seems to be a bug that shows the Property platform is not allowed error in the editor. The file is still ok and works in my case. See here: https://github.com/keesschollaart81/vscode-home-assistant/issues/1866

This is what it looks like in my case (and this file is perfectly fine, it’s just the editor that complains about it):
image

1 Like

Yes, it is in Studio Code. Thank guys.