"Platform" is not a valid option for a template binary sensor (ping)?

Until now, I’ve been doing network pings through Node-RED exclusively. I was playing around with setting up some binary sensors in my templates.yaml file (referenced from configuration.yaml) and this is causing problems:

# Network ping sensors
  - binary_sensor:
    - unique_id: upstairs_mesh_node
      name: Mesh Node
      platform: ping
      host: 192.168.1.1
      count: 5
      scan_interval: 600

I get this error on checking config:

Logger: homeassistant.config
Source: config.py:916
First occurred: 8:31:55 AM (7 occurrences)
Last logged: 8:42:42 AM

Invalid config for [template]: [platform] is an invalid option for [template]. Check: template->binary_sensor->0->platform. (See /config/templates.yaml, line 659).

The sensor syntax, spacing and everything is identical to my other sensors. Any ideas?

You got that error because you added a Ping Binary Sensor into a file reserved for the configuration of Template entities.

That’s what this line in your configuration.yaml file means:

template: !include templates.yaml
   ^
   |
Template entities 

Move the Ping Binary Sensor out of the templates.yaml file.

1 Like

Oof, thank you. I’ve made this error before and forgot what I learned. I’ve placed it in a new file, binary_sensors.yaml.

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

Done, thanks again,

1 Like