52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
blueprint:
|
|
name: Test-Macro
|
|
description: Prova Jinja2 Macro
|
|
domain: automation
|
|
author: Tiziano Trabattoni
|
|
# input:
|
|
# window_sensor:
|
|
# name: Window Status
|
|
# description: Identifies the Window Sensor Device for Opened Status
|
|
# selector:
|
|
# entity:
|
|
# filter:
|
|
# - device_class: door
|
|
# domain: binary_sensor
|
|
|
|
variables:
|
|
recipient_list:
|
|
- notify.mobile_app_tiziano_iphone15pro
|
|
# - notify.mobile_app_emanuele_s24
|
|
evcharge_entity1_power_var: >-
|
|
{% from 'template_library.jinja' import getpower_id %}
|
|
{{ getpower_id('switch.evcharge_back') }}
|
|
|
|
triggers:
|
|
- trigger: mqtt
|
|
topic: zigbee2mqtt/Pulsante-01
|
|
payload: single
|
|
value_template: "{{ value_json['action'] }}"
|
|
id: Pulsante1-single
|
|
|
|
conditions: []
|
|
actions:
|
|
- choose:
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-on
|
|
- test_animation
|
|
sequence:
|
|
# Hereafter the attemped usage as variable initialization
|
|
- repeat: # send message to all recipient-list members
|
|
for_each: "{{ recipient_list }}"
|
|
sequence:
|
|
- action: "{{ repeat.item }}"
|
|
metadata: {}
|
|
data:
|
|
message: >-
|
|
"TEST -> >>{{ evcharge_entity1_power_var }}<<"
|
|
title: TEST TEST
|
|
|
|
mode: single
|