Git Product home page Git Product logo

healthchecksio's Introduction

healthchecksio

GitHub Release GitHub Activity License

hacs Project Maintenance BuyMeCoffee

Discord Community Forum

Integration to integrate with healthchecks.io.

example

Installation

Search for and install healthchecksio from HACS

Configuration

This integration can only be configured via the UI.

Check ID

This is the ID of the check that the integration should update, this ID looks something like aa247c51-8da8-4800-86a3-48763142e902

This integration will send an update to it every 5 minutes.

API Key

The API key to your account. You can find it under the "Settings" tab in your project. This should not be the "Read only" key.

For self-hosted instances

Site Root

This is the root URL of your Healthchecks.io instance.

Ping Endpoint

This is the path of the endpoint used for pings.

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines


healthchecksio's People

Contributors

drthanwho avatar guykh avatar kuchel77 avatar ludeeus avatar markusressel avatar mincka avatar snuffy2 avatar yuvalabou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

healthchecksio's Issues

I dont understand how to integrate it in HA

I just installed the component via HACS, rebooted HA, but I can't understand how to configure it. Can't find any new entity ecc. What do I have to do to insert url and apy? Thank you

How to Ingest Projects/Jobs into HomeAssistant?

Is your feature request related to a problem? Please describe.
Hello. I am new to Healthchecks.io, but really like the service. I had manually implemented a very similar (but harder to maintain) solution in Home Assistant using Webhooks and Select entities, but I think that Healthchecks is a more elegant and scalable solution. So, I spun up a self-hosted Docker container and plugged in my scheduled job (which currently run alongside the Webhooks I made already).

I am confused how to integrate data from Healthchecks.io into Home Assistant (version 2022.3.1), if it is possible to do so. Based on the image in the README, I expected to connect the server from Home Assistant and get information for each of my healthchecks. I have installed this integration (version 22.2.0) into HACS and added an instance of it using my API key, which succeeds (my server is self-hosted). However, I end up with an Integration that has no Devices or Entities. It looks like HA will ping my healthchecks per the ID I provide.

Maybe I am confused about what this Integration provides, or it provides different information for web-users vs. self-hosters? The README does not actually describe what this Integration does, or what information/functionality is provided.

Describe the solution you'd like
I would like this (or another) Integration to connect to a Healthchecks server from Home Assistant (using the API key, maybe even the read-only one). I would then like some Devices and/or Entities to be provided, with connectivity status (maybe Unknown, Up-to-Date, Grace Period, and Delinquent), the time of the last successful ping, and the time of the last state change.

Either way, if this Integration is not intended to provide that ability, I think it would be helpful to clearly identify exactly what it can do/provide in the README.

Describe alternatives you've considered
I have created a similar but cruder solution using Webhooks in Home Assistant. This required manually creating an Input Select and an Input Datetime entity for each healthcheck/job, and a few automations to inspect for out-of-date tasks.

Additional context
Thank you for your help.

Allow for configuration of schedule

On the "healthchecks.io" webpage, I can configure:
Period 5 minutes
(The expected time between pings)
Grace Time 15 minutes
(When a check is late, how long to wait to send an alert)

This custom component should also allow configuration of those items

Pull in new checks

Version of the custom_component

22.2.0

Configuration

Custom

            {
                "entry_id": "dfdecc7e737fcf402d0daa71494c24d6",
                "version": 1,
                "domain": "healthchecksio",
                "title": "0c476f1e-918d-4583-b0f2-e7643761da84",
                "data": {
                    "api_key": "mykey",
                    "check": "mycheck",
                    "self_hosted": true,
                    "site_root": "https://healthchecks.mydomain.com",
                    "ping_endpoint": "ping"
                },
                "options": {},
                "pref_disable_new_entities": false,
                "pref_disable_polling": false,
                "source": "user",
                "unique_id": null,
                "disabled_by": null
            }

Describe the bug

New checks added to my instance are not added or showing up in Home Assistant

Expectation

When new checks are added, the Entities in Home Assistant are (albeit delayed) updated with the new checks added.

Sensor becomes "Unavailable" after reboot

Home Assistant Version:
Core 2024.2.2
Supervisor 2024.02.0
Operating System 11.5
Frontend 20240207.1

Integration Version: 22.2.0

The sensor has a disclaimer: "This entity is no longer being provided by the healthchecksio integration. If the entity is no longer in use, delete it in settings."

The integration was added to HACS, than configured from the integration screen.
After initial configuration, everything works fine, ping is successfully received each 5 minutes.
But after the restart, the sensor permanently switches to unavailable state and don't come back, unless the integration is deleted, reinstalled and reconfigured.

What's very odd, is that I don't see anything in logs related to this integration

I'm also on a pretty fresh Home Assistant installation, in fact so fresh, that I never edited configurations.yaml directly.

Here you can unmistakably determine when HA was rebooted and when the integration was reinstalled
Screenshot 2024-02-23 at 14 44 10

No 'version' key in the manifest file for custom integration 'healthchecksio'.

Version of the custom_component: 1.0.0

Configuration

Configured through the Integrations Page

N/A

Describe the bug

On HomeAssistant 2021.3.0:

No 'version' key in the manifest file for custom integration 'healthchecksio'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'healthchecksio'

https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes outlines the information as for why

Debug log


No 'version' key in the manifest file for custom integration 'healthchecksio'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'healthchecksio'

Error on Device update

Version of the custom_component

21.3.0

Configuration

HACS > Integrations > Setup through UI

Describe the bug

The first ping was successful but immediately after there was an error in my logs.
A have gotten around this by just deleting this HACS integration and using the method from #13, however I would like to be able to use integrations over yaml, where possible.

Debug log


healthchecksio: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 482, in async_device_update
    await task
  File "/config/custom_components/healthchecksio/binary_sensor.py", line 45, in async_update
    if self.unique_id == check.get("ping_url").split("/")[-1]:
  File "/config/custom_components/healthchecksio/binary_sensor.py", line 57, in unique_id
    return self.config.get("ping_url").split("/")[-1]
AttributeError: 'NoneType' object has no attribute 'split'

Sensors report false Disconnected state

Describe the bug

The sensors often report "Disconnected" state and come back 5 minutes later. They seem to skip a ping. However, there's no skipped ping or grace period.

Here's a comparison between this manual config (with 300 seconds for update interval) and this integration:
image

image

image

Maybe the timeout set to 10 seconds is a little bit too small from time to time.

Still, I don't get why the result would be different from HA vs others. It's mainly concerning HA in my case.

Debug log

I enabled debug logging in the integration but I did not see anything relevant.

BinarySensorDevice is deprecated, modify HealthchecksioBinarySensor to extend

Hi, noticed this in my logs recently

`Log Details (WARNING)
Logger: homeassistant.components.binary_sensor
Source: components/binary_sensor/init.py:139
Integration: Binary sensor (documentation, issues)
First occurred: 9:08:14 AM (1 occurrences)
Last logged: 9:08:14 AM

BinarySensorDevice is deprecated, modify HealthchecksioBinarySensor to extend BinarySensorEntity
Connection lost. Reconnecting…
`

HealthChecks.io Version: 0.1.3 (latest)
HASS.io latest version (0.110.2)
HACS store latest version (1.0.3)

Unsure what the bug means, HealthChecks.io system appears to be reporting correctly.

Integrations not loading after restart

When I add the Health Checks IO integration through HACs and configure it everything works great but when I restart my home-assistant instance it throws an error. I'm assuming the issue is because of the slow starts so everything isn't initialized but because the error is caught and it will still try and set up the binary_sensor.

I took a look at the code and from what I can tell the error is happening in __init__.py line 87 so self.hass.data[DOMAIN_DATA]["data"] is never being initialized which means the binary sensor blows up later on when the data property is not there to loop through.

Error 1
Could not update data -

Error 2

Log Details (ERROR)
Thu Oct 03 2019 12:37:07 GMT-0500 (Central Daylight Time)
Error while setting up platform healthchecksio
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/healthchecksio/binary_sensor.py", line 11, in async_setup_entry
for check in hass.data[DOMAIN_DATA]["data"].get("checks", []):
KeyError: 'data'
{
                "connection_class": "cloud_poll",
                "data": {
                    "api_key": "[valid api key]",
                    "check": "[valid check guid]"
                },
                "domain": "healthchecksio",
                "entry_id": "[Probably a random string but removing it incase it important]",
                "options": {},
                "source": "user",
                "system_options": {
                    "disable_new_entities": false
                },
                "title": "[valid check guid]",
                "version": 1
}

Version 0.1.2

Not sending ping to defined check

Version of the custom_component

0.1.1

Configuration

config_flow

Describe the bug

A clear and concise description of what the bug is.

Debug log


Add your logs here.

Unclear how to configure from the UI

After adding HealthchecksIO via the HACS integrations area, there is no ability to edit the settings from the UI, like the readme describes.

Screen Shot 2021-02-28 at 8 18 04 AM

Uploading Screen Shot 2021-02-28 at 8.17.57 AM.png…

Are you supposed to add a new entity/device? The instructions are very unclear.

Error while setting

2021-01-28 15:15:31 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'

loop keyword argument is deprecated

Version of the custom_component

Latest

Configuration

The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for healthchecksio using this method at custom_components/healthchecksio/__init__.py, line 104: async with async_timeout.timeout(10, loop=asyncio.get_event_loop()):

Describe the bug

async_timeout.timeout called with loop keyword argument which is deprecated as of 2021.12 and will soon be removed. The logging is also slightly verbose

Debug log


Add your logs here.

Missing from "add integration"

Version of the custom_component

1.0.0

Configuration

Add your logs here.

Describe the bug

A clear and concise description of what the bug is.
When i moved to HomeAssistant Blue i cant find the "Healthchecks.io" integration in home assistant
I have installed from hacs and restarted many times.
I get no errors but i dont have "Healthchecks.io" to chose in integrations.
It still appears in my old instant on my intel nuc.

Debug log


Add your logs here.

First ping works, subsequent ones never reach Healthcheck.io

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

Binary sensors not added in Home Assistant 2023.3.3

I am running

  • Home Assistant 2023.3.3
  • Supervisor 2023.03.1
  • Operating System 9.5
  • Frontend 20230309.0 - latest

I added the custom component via HACS and then added it via the integration. I get one successful ping after I restart HA, but none afterwards. I also cannot find any binary sensors matching the description.

Unable to configure integration ( ` No module named 'sampleclient' `)

Version of the custom_component 1.0

Hass 0.97.2

Configuration

n/a

Describe the bug

when I go to the integration UI and select healthchecks.io from the list I get the following error in the logs:

2019-08-12 16:15:14 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading config flow for integration healthchecksio: No module named 'sampleclient'

Debug log


Add your logs here.

Integration fails completly if initial setup fails

The integration does not recover when the initial setup fails.

Unfortunately, I was not able to generate more helpful information than this log output:

ERROR (MainThread) [custom_components.healthchecksio] Could not update data -

Which seems to come from here:
https://github.com/custom-components/healthchecksio/blob/main/custom_components/healthchecksio/__init__.py#L118

On my Raspberry Pi 3 with HASSOS it fails to initialize the Integration about every second time and I have not yet been able to identify the problem. It seems that a simple retry should help but I'm not sure how I could force it to do so. I've even added a job that updates the sensory every 2 minutes.

Use of `async_add_job` is Deprecated (removal in HA 2025.4)

Version of the custom_component

22.2.0

Configuration

Detected that custom integration 'healthchecksio' calls `async_add_job`, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/healthchecksio/__init__.py, line 76: hass.async_add_job(, please create a bug report at https://github.com/custom-components/healthchecksio/issues

Describe the bug

This integration uses a now-deprecated API call to Home Assistant. I believe guidance to update to a non-deprecated way is here: https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job

Debug log


Add your logs here.

Can't add multiple projects

Version of the custom_component

22.2.0

Describe the bug

healthchecks.io organizes checks in projects. Projects each have their own API keys and Check ID. In order to add all my projects I tried to add the integration multiple times so I can provide the Check ID and API Key for each of my projects. But when I try to add another integration it says "Only a single configuration of Blueprint is allowed".

I can only add one of my projects to Home Assistant.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.