Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Created January 26, 2025 22:59
Show Gist options
  • Save Didgeridrew/25aa0e9a478e92d033de7b625e914a99 to your computer and use it in GitHub Desktop.
Save Didgeridrew/25aa0e9a478e92d033de7b625e914a99 to your computer and use it in GitHub Desktop.
blueprint:
name: Testing Trigger-based Template Blueprint
domain: template
input:
input_var_1:
input_var_2:
variables:
var_1: !input input_var_1
var_2: !input input_var_2
trigger:
- triggers:
- platform: state
entity_id: input_boolean.ztest_new_bool
action:
- action: notify.persistent_notification
data:
message: |-
var_1: {{var_1}}
var_2: {{var_2}}
sensor:
- state: >-
{{ var_1|int(0) + var_2|int(0) }}
--------------------------------------------------------------------
blueprint:
name: Save a time
description: Creates a sensor which holds the time of a trigger event
domain: template
input:
trigger:
name: Trigger
description: The trigger
exclude:
name: Exclude Mod
description: Any integer, the modulo of which will be excluded from minutes that update state
trigger: !input trigger
variables:
mod: !input exclude
condition:
- condition: template
value_template: "{{ now().minute % mod != 0 }}"
sensor:
state: "{{ now() }}"
availability: "{{true}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment