Certificate Expiry

The Certificate Expiry integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] monitors the expiration date of an SSL/TLS certificate for a configured host. This is useful for keeping track of when certificates need to be renewed, for example, for your own website or Home Assistant’s remote access certificate.

Configuration

To add the Certificate Expiry service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select Certificate Expiry.

  • Follow the instructions on screen to complete the setup.

Host

The hostname to check the certificate for, for example, home-assistant.io. Do not include https:// or a path to a file on your computer.

Port

The port to connect to. The default is 443.

Supported functionality

Sensors

The integration creates a single sensor for each configured host.

  • Certificate expiry
    • Description: The expiration date and time of the host’s SSL/TLS certificate.
    • Device class: Timestamp. The state is a UTC datetime, not a number of days. The Home Assistant UI might display it as “in X days,” but this is only a display format.

The sensor also provides the following attributes:

  • is_valid: Whether the certificate has been validated (true or false).
  • error: A human-readable error description if the certificate is considered invalid, or None when the certificate is valid.

Tip

To calculate the number of days until the certificate expires in a template or automation, use as_datetime() to convert the state and subtract now(). For example:

value_template: >
  {{
    (as_datetime(states('sensor.cert_expiry_timestamp_example_com'))
    - now()).days
  }}

Data updates

The integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] the certificate every 12 hours. To trigger an immediate check, use the homeassistant.update_entity action.

Known limitations

The integration only provides the certificate expiration date. It does not provide the issue date, certificate lifetime, renewal window, or any ACME-specific information.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.