So normally you would write a blueprint Trigger for a state change & use the !input directly.
E.g.
blueprint:
name: test
domain: automation
input:
input_select_one:
name: One
description: something
selector:
entity:
domain: input_select
input_select_two:
name: Two
description: something
selector:
entity:
domain: input_select
trigger:
- platform: state
entity_id:
- !input input_select_one
- !input input_select_two
id: Input-Changed
action:
- service: notify.persistent_notification
data:
message: "{{ trigger.id }}"
But if you want to make the !input optional, you need to write the trigger as A template, but how do you do this? As an automation it can be done
description: test
mode: single
trigger:
- platform: template
value_template: >-
{{ as_timestamp(now()) - as_timestamp(
states.input_select.input_select_one.last_changed ) < 1 }}
id: Input-One
- platform: template
value_template: >-
{{ as_timestamp(now()) - as_timestamp(
states.input_select.input_select_two.last_changed ) < 1 }}
id: Input-Two
condition: []
action:
- service: notify.persistent_notification
data:
message: "{{ trigger.id }}"
But you can’t use A variable to do that for a Blueprint, or at-least I haven’t figured out how?
E.g.
blueprint:
name: test
domain: automation
input:
input_select_one:
name: One
description: something
selector:
entity:
domain: input_select
input_select_two:
name: Two
description: something
selector:
entity:
domain: input_select
trigger_variables:
input_select_one: !input input_select_one
input_select_two: !input input_select_two
trigger:
- platform: template
value_template: "{{ as_timestamp(now()) - as_timestamp( states.[input_select_one].last_changed ) < 1 }}"
id: Switch-Changed
- platform: template
value_template: "{{ as_timestamp(now()) - as_timestamp( states.[input_select_two].last_changed ) < 1 }}"
id: Switch-Changed
action:
- service: notify.persistent_notification
data:
message: "{{ trigger.id }}"
Any tip’s would be much appreciated?