Check if sensors exists on startup/reboot hassio

Hi, since there is a issue with the remote_gpio platform, when we restart hassio, it happens that this platform is not loaded correctly, so the problem is that the sensors are not created…
i see that in the log file, but i want to alert myself with a message instead of always looking in the log file

so created the automation below, but it doesnt trigger, i dont know how to actually check if an entity / binary_sensor, in my case excists? so i need change the condition, but how?

     
- alias: Raspberry GPIO Check Startup
  initial_state: 'on'
  trigger:
    platform: homeassistant
    event: start
  condition:
    condition: template
    value_template: '{{ not is_state("binary_sensor.gpio_23", "unavailable") }}'
  action:
    service: notify.html5
    data_template:
      message: "Attention: Raspberry Error"
      title: "Raspberry"
      target:       
      - !secret notify_html5_1     

ok, this works:

- alias: Raspberry GPIO Check Startup
  initial_state: 'on'
  trigger:
    platform: homeassistant
    event: start
  condition:
  - condition: template
    value_template: "{{ states.binary_sensor.gpio_23.state != 'on' }}"

I think a better way to do this is:

  condition:
  - condition: template
    value_template: "{{ states.binary_sensor.gpio_23 is none }}"

thx, changed my code :slight_smile:

1 Like