custom-components / healthchecksio

Update and display the status of your healthchecks.io checks.
MIT License
48 stars 9 forks source link

First ping works, subsequent ones never reach Healthcheck.io #13

Closed quanturium closed 3 years ago

quanturium commented 3 years ago

I've set up the plugin from HACS and the first ping works correctly. Any subsequence ping never reached their server.

Here are the logs I've found from home-assistant.log

2021-01-13 16:53:55 ERROR (MainThread) [custom_components.healthchecksio] Could not update data - 
2021-01-13 16:53:55 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up healthchecksio platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/healthchecksio/binary_sensor.py", line 17, in async_setup_entry
    for check in hass.data[DOMAIN_DATA]["data"].get("checks", []):
KeyError: 'data'

EDIT: I was able to repro this on the previous and current version of this integration

ishalem commented 3 years ago

I have the same issue

clockiee commented 3 years ago

Hello I seem to be having the same problem as the two above, is there a work around or am I missing a setting? Any help would be appreciated so much

quanturium commented 3 years ago

If you're only using this extension to send a ping to healthcheck.io, an alternative and much simple solution is this:

configuration.yaml

rest_command:
healthcheckio:
url: HEALTHCHECKIO_URL (e.g. https://hc-ping.com/xxxxxx)
method: GET

automation.yaml

- id: "1610586454189"
alias: Healthcheckio ping
description: ""
trigger:
- platform: time_pattern
minutes: "/2"
condition: []
action:
- service: rest_command.healthcheckio
data: {}
mode: single

This will send a ping every other minute to your healhcheckio endpoint.

clockiee commented 3 years ago

That's what I ended up doing and now it's working thank you