"Platform not found: sensor.ping" when trying to move them to a sensors.yaml

when in the configuration.yaml file they work correctly

binary_sensor:
  - platform: ping
    name: JiPhone7
    host: 192.168.0.79
    count: 2
    scan_interval: 300
  - platform: ping
    name: CiPhone7
    host: 192.168.0.80
    count: 2
    scan_interval: 300

when moved to the sensors.yaml file “as is” I get an error on the first line with the
- platform: ping when I run “check config”.

When I remove the leading two spaces from the first entry and check the config it tells me there’s an error on the line of the second
- platform: ping .

When I remove the two spaces from the second device and the code looks like this

- platform: ping
  name: JackiesiPhone7
  host: 192.168.0.79
  count: 2
  scan_interval: 300
- platform: ping
  name: CatherisiPhone7
  host: 192.168.0.80
  count: 2
  scan_interval: 300

When I run “check config” I get the error
“Platform not found: sensor.ping”
“Platform not found: sensor.ping” .

I did a reboot to reload to try it and I have this in my error log

2018-09-01 21:58:04 ERROR (MainThread) [homeassistant.loader] Unable to find component sensor.ping
2018-09-01 21:58:04 ERROR (MainThread) [homeassistant.loader] Unable to find component sensor.ping

Can ping not go in an !include file?

btw, existing sensors.yaml

#sensors.yaml
# Sensor mqtt
  - platform: mqtt
    state_topic: 'location/owner/first floor/cd:d3:c0:34:37:94'
    value_template: '{{ value_json.confidence }}'
    unit_of_measurement: '%'
    name: 'RG8'
    
  - platform: mqtt
    state_topic: 'location/owner/first floor/B8:53:AC:46:7C:53'
    value_template: '{{ value_json.confidence }}'
    unit_of_measurement: '%'
    name: 'Cats IP7'

#sensor wc:
  - platform: worldclock
    time_zone: America/Chicago

#sensor pi_hole:
  - platform: pi_hole
    host: 192.168.0.103:80
    monitored_conditions:
      - ads_blocked_today
      - dns_queries_today
      - unique_clients

#sensor ha_ver:
  - platform: command_line
    name: "HA Version"
    command: "cat .HA_VERSION" 

Maybe because “ping” is a “binary_sensor”, not a “sensor”?

try putting it in a binary_sensors.yaml file. and then !include that file.

3 Likes

that was it, thanks