Custom Component: Websitechecker

When I was looking for a way to check if my (internally) hosted webservices were running fine or not I could not really find anything suitable. Most people seem to use external services (does not work for internal websites) or ping/rest/scrape solutions, but I found those a bit annoying to setup, so I made this integration.

You provide a list of URLs to check and it will expose each of those as a “problem” sensor.
For the most recent documentation checkout the in the linked repository

Example configuration.yaml:

websitechecker:
  update_interval: 10   # Optional, value in minutes, defaults to 10
  websites:
    - url: https://example.com
      name: Optional friendly name
      update_interval: 5   # Optional, main `update_interval` used when not provided
      verify_ssl: false  # Optional, default is true
    - url: http://does_not_exist.com

Shown in an Entities card:

image

7 Likes

Is there a way to increase the 10 min check window?

No there is currently no option to change the scan interval.
Feel free to submit an issue as a reminder (or even better a PR), no promises on me working on it any time soon though.

@blair.ogilvie1 until @Michel updates the component, you can simply edit the binary_sensor.yaml file and change the interval there, then restart HA and it’ll be as you want:

SCAN_INTERVAL = timedelta(minutes=10)

You could also add additional logic to specify the sensor limit on each entry if you are familiar with Python and the HA model.

What is the best way to somehow notify me in case of trouble, without doing something per-site?

You could create a sensor for each site and then use a template sensor or an average/sum sensor to give you an indication if any of the sites are down rather than one-by-one.

You could make a group helper sensor. When one (or more) of the sensors in the group is on the group sensor will be on. You could then trigger automations on that.

You might get more response in other sections of the forum as it is basically a more general automation question.

For the people following this, I just pushed an update that allows you to set a custom update_interval. Check the readme for info on how to configure.

This component is exactly what I’ve been looking for.

There are two features that (for me at least) would make this perfect: 1) exposing the URL in the sensor attributes (apologies if this is doable with unique_id… i just don’t know how) 2) allowing users to add an optional icon for each sensor

Adding the URL as an attribute should not be too hard. Will see if I can add that.

Changing the icon can already be done (for all entities) through the cogwheel icon in the HA UI or through customization.yaml.

FYI I released v1.1.0 that has the url as an attribute on each of the sensors.

Hi, would it be possible to add support to ignore ssl certificate (self signed) error? Most Integrations have verify_ssl=true/false config.

Sure, just released v1.5.0 with verify_ssl option. See readme for an example.

Wow, you are awesome! I have installed the update and it’s working well for me. Appreciate your quick revert. Thanks!

3 Likes

After struggling with a way to detect when my internet goes down (ISP outage) I was finally able to get it working with your component easily. I just put my ping url from healthchecks.io in and BAM worked great.

THANK YOU, MICHEL! :grinning:

1 Like