Rest sensor errors on startup



  - platform: rest
    name: Hassio Main config
    resource: !secret resource_hassio_main_config
    authentication: basic
    value_template: >
      {{ value_json.version }}
      - components
      - unit_system
      - config_dir
      Content-Type: application/json
      Authorization: !secret api_bearer_token
      User-Agent: Home Assistant REST sensor

always errors out in the startup log:

2019-07-01 08:35:10 ERROR (SyncWorker_9) [] Error fetching data: <PreparedRequest [GET]> from https://redacted/api/config failed with HTTPSConnectionPool(host='redacted', port=8124): Max retries exceeded with url: /api/config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6d4e2ff0>: Failed to establish a new connection: [Errno 111] Connection refused'))

afterwards this is repeated a couple of times, and when HA finally loads, the sensor is there alright, which also means the config of the sensor itself should be fine.

apparently the sensor tries to load too soon for HA, but can we postpone that somehow?

thanks for having a look