[GH-ISSUE #1166] Home Assistant #803

Open
opened 2026-02-25 23:43:38 +03:00 by kerem · 7 comments
Owner

Originally created by @gensyn on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1166

I would love to be able to signal Home Assistant about missing health checks and would be willing to give it a try myself. Is this something you would consider merging?

Originally created by @gensyn on GitHub (May 29, 2025). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1166 I would love to be able to signal Home Assistant about missing health checks and would be willing to give it a try myself. Is this something you would consider merging?
Author
Owner

@cuu508 commented on GitHub (May 30, 2025):

I'm not familiar with Home Assistant, how would it work? Would the user get an alert in a Home Assistant app, or would this be a "sensor" with its status visible in Home Assistant, or would it be used as a trigger for some automation? What API would be used to signal Home Assistant?

<!-- gh-comment-id:2922488227 --> @cuu508 commented on GitHub (May 30, 2025): I'm not familiar with Home Assistant, how would it work? Would the user get an alert in a Home Assistant app, or would this be a "sensor" with its status visible in Home Assistant, or would it be used as a trigger for some automation? What API would be used to signal Home Assistant?
Author
Owner

@gensyn commented on GitHub (May 30, 2025):

Home Assistant has a powerful REST API. All you need is the URL and a Long-Lived Access Token (API key) which is sent in the authentication header. Any authenticated user can create such a token.

There are several ways this could be handled and I haven't thought that long about what is the best solution. The most simple implementation would allow the user to enter a binary_sensor entity which the integration turns on when the healthcheck is missed. The user can then create an automation to be triggered when the entity is turned on, which could send a notification (which is what I would use it for) or do any other number of things like flash the lights in the living room or just display the information on a dashboard.
A more sophisticated approach would allow to include some data about the healthcheck, but I would start with the basic solution and take it from there.
I was actually surprised that no one has asked about a Home Assistant integration yet.

<!-- gh-comment-id:2923240514 --> @gensyn commented on GitHub (May 30, 2025): Home Assistant has a powerful [REST API](https://developers.home-assistant.io/docs/api/rest/). All you need is the URL and a Long-Lived Access Token (API key) which is sent in the authentication header. Any authenticated user can create such a token. There are several ways this could be handled and I haven't thought that long about what is the best solution. The most simple implementation would allow the user to enter a `binary_sensor` entity which the integration turns on when the healthcheck is missed. The user can then create an automation to be triggered when the entity is turned on, which could send a notification (which is what I would use it for) or do any other number of things like flash the lights in the living room or just display the information on a dashboard. A more sophisticated approach would allow to include some data about the healthcheck, but I would start with the basic solution and take it from there. I was actually surprised that no one has asked about a Home Assistant integration yet.
Author
Owner

@gensyn commented on GitHub (Jun 11, 2025):

So, what do you think?

<!-- gh-comment-id:2961329656 --> @gensyn commented on GitHub (Jun 11, 2025): So, what do you think?
Author
Owner

@adamchengtkc commented on GitHub (Jul 15, 2025):

It has a system health endpoint https://www.home-assistant.io/integrations/system_health/

Instead of the monitored system pinging healthcheck.io, would it be possible for healthcheck.io to periodically ping an external endpoint? Perhaps also parsing the response JSON?

Alternatively, you can set up an automation that periodically call a rest command https://www.home-assistant.io/integrations/rest_command/ toward healthcheck.io

<!-- gh-comment-id:3073423970 --> @adamchengtkc commented on GitHub (Jul 15, 2025): It has a system health endpoint https://www.home-assistant.io/integrations/system_health/ Instead of the monitored system pinging healthcheck.io, would it be possible for healthcheck.io to periodically ping an external endpoint? Perhaps also parsing the response JSON? Alternatively, you can set up an automation that periodically call a rest command https://www.home-assistant.io/integrations/rest_command/ toward healthcheck.io
Author
Owner

@gensyn commented on GitHub (Jul 15, 2025):

Sure, there are alternatives, but I prefer pushing over polling and I think it would be easy enough to implement.

<!-- gh-comment-id:3073473300 --> @gensyn commented on GitHub (Jul 15, 2025): Sure, there are alternatives, but I prefer pushing over polling and I think it would be easy enough to implement.
Author
Owner

@cuu508 commented on GitHub (Sep 29, 2025):

@gensyn to help me better understand the proposal, could you perhaps describe a couple concrete use cases –

  • what's the system sending ping requests to Healthchecks?
  • what could cause the monitored system not to check in on time?
  • when that happens, what automation would run, for what purpose?

I can come up with ridiculous ideas like "when the cat door has not been triggered for 12 hours then sound the big horn" but I'm interested in some realistic scenarios just to understand it all better.

Also, Healthchecks already has webhook integration. Perhaps it can be used already, at least for a proof-of-concept solution before a "native" integration exists?

<!-- gh-comment-id:3346041366 --> @cuu508 commented on GitHub (Sep 29, 2025): @gensyn to help me better understand the proposal, could you perhaps describe a couple concrete use cases – * what's the system sending ping requests to Healthchecks? * what could cause the monitored system not to check in on time? * when that happens, what automation would run, for what purpose? I can come up with ridiculous ideas like "when the cat door has not been triggered for 12 hours then sound the big horn" but I'm interested in some realistic scenarios just to understand it all better. Also, Healthchecks already has webhook integration. Perhaps it can be used already, at least for a proof-of-concept solution before a "native" integration exists?
Author
Owner

@gensyn commented on GitHub (Sep 29, 2025):

My use case was to replace Gotify. Right now I have a Gotify server and the Gotify App installed only to be notified if one of my Healthchecks fails. These are mostly backup-related. If I could instead signal a failure to Home Assistant, I could use the Home Assistant companion app to notify me.

That being said, I did not consider using a webhook trigger in Home Assistant, which would probably work just fine. And I would not need to place my credentials for Home Assistant in healthchecks, so I'm seeing a lot of benefits here. I will give this a try and - assuming this indeed works - withdraw my request. Thanks!

<!-- gh-comment-id:3347641305 --> @gensyn commented on GitHub (Sep 29, 2025): My use case was to replace Gotify. Right now I have a Gotify server and the Gotify App installed only to be notified if one of my Healthchecks fails. These are mostly backup-related. If I could instead signal a failure to Home Assistant, I could use the Home Assistant companion app to notify me. That being said, I did not consider using a webhook trigger in Home Assistant, which would probably work just fine. And I would not need to place my credentials for Home Assistant in healthchecks, so I'm seeing a lot of benefits here. I will give this a try and - assuming this indeed works - withdraw my request. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#803
No description provided.