Skip to content

Instantly share code, notes, and snippets.

@hollie
Last active May 29, 2021 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hollie/1889a4adbb7610c5296496cdb3221ca4 to your computer and use it in GitHub Desktop.
Save hollie/1889a4adbb7610c5296496cdb3221ca4 to your computer and use it in GitHub Desktop.
SSL check blueprint
blueprint:
name: Certificate Expiration by bkbilly
description: 'This automation blueprint notifies when a SSL certificate is about to expire'
domain: automation
input:
certificate_input:
name: Certificate
description: The certificate timestamp
selector:
entity:
integration: cert_expiry
days_input:
name: Days before
description: Set how many days before expiration it should start sending notifications
default: 5
selector:
number:
min: 0
max: 100
unit_of_measurement: days
mode: slider
step: 1
time_input:
name: Time
description: What time of the day it should check and send the notification?
default: '15:00'
selector:
time:
target_action:
name: Action
description: What should be done, when the timer expires?
selector:
action:
trigger:
platform: time
at: !input 'time_input'
variables:
days_var: !input 'days_input'
certificate_var: !input 'certificate_input'
expire_days_var: '{{ ((as_timestamp(states(certificate_var)) - as_timestamp(now())) / 60 / 60 / 24 ) | int }}'
condition:
condition: template
value_template: "{{ expire_days_var < days_var }}"
action:
- choose:
default: !input 'target_action'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment