I modified the blueprint so that it can support custom actions. I haven’t tried it, so let me know if you got any problems.
Edit or create a new blueprint. Mine is located at this path:
<installdir>/blueprints/automation/bkbilly/certificate-expiration.yaml
blueprint:
name: Certificate Expiration
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'