Hi, I’m trying to create this blueprint, but I got this message when trying to use that in automations:
Message malformed: Entity entity_id is neither a valid entity ID nor a valid UUID for dictionary value @ data['action'][0]['choose'][3]['sequence'][0]['if'][0]['entity_id']
blueprint:
name: Luci temporizzate
description:
Ascolta un segnale e accende una luce per n secondi. Al termine del tempo ripristina lo stato iniziale
o quello impostato nel frattempo.
domain: automation
# source_url: https://gist.github.com/CyanAutomation/1b8bafd033f73e3c24e42e8f381ff906
input:
entity_segnale_on:
name: Segnale
description: Questa è l'entità che fa scattare il timer
selector:
target:
entity:
domain: input_boolean
target_light:
name: Luce
description: Questa è l'entità della luce che verrà accesa
selector:
target:
entity:
domain: light
target_timer:
name: Timer
description: Questo è il timer che gestisce la durata di accensione della luce
selector:
target:
entity:
domain: timer
target_durata_timer:
name: Durata timer
description: Questa è l'entità che salva i secondi di durata del timer
default: 30
selector:
number:
max: 0
min: 300
# target:
# entity:
# domain: input_number
# default: 120
# selector:
# number:
# min: 0
# max: 3600
# unit_of_measurement: seconds
# state_before:
# name: Stato prima dell'attivazione
# description: Questa è l'entità che memorizza lo stato della luce prima dell'automazione
# selector:
# target:
# entity:
# domain: input_boolean
variables:
# entity_segnale_on: !input "entity_segnale_on"
target_light: !input "target_light"
trigger:
- platform: state
entity_id: !input entity_segnale_on
id: devo_accendere_dispositivo
to: "on"
- platform: state
entity_id: !input target_timer
id: timer_attivato
to: active
- platform: state
entity_id: !input target_timer
id: timer_disattivato
to: idle
- platform: state
entity_id: !input target_light
id: stato_cambiato
action:
- choose:
# se arriva il segnale per accendere il dispositivo:
# spegno il segnale
# se il timer è spento (= primo trigger) allora salvo stato attuale del dispositivo
# avvio il timer
- conditions:
- condition: trigger
id: devo_accendere_dispositivo
sequence:
- service: input_boolean.turn_off
target: !input entity_segnale_on
# - if:
# condition: state
# entity_id:
# - !input target_timer
# state: idle
# # - condition: state
# # entity_id: !input target_timer
# # state: idle
# then:
# - service: scene.create
# data:
# scene_id: >-
# '{{target_light}}'_prima
# snapshot_entities: !input target_light
- service: timer.start
data:
duration: !input target_durata_timer
target: !input target_timer
# se il timer è partito
# accendo il dispositivo
- conditions:
- condition: trigger
id: timer_attivato
sequence:
- service: light.turn_on
target: !input target_light
# se il timer è fermo
# ripristino la scena prima del trigger
- conditions:
- condition: trigger
id: timer_disattivato
sequence:
- service: scene.turn_on
target: scene.{{target_light}}_prima
# se lo stato del dispositivo cambia
# se il timer è in corso, sovrascrivo la scena con lo stato da ripristinare dopo il timer
- conditions:
- condition: trigger
id: stato_cambiato
sequence:
if:
- condition: state
entity_id: !input target_timer
state: active
then:
- service: scene.create
data:
scene_id: >-
'{{target_light}}'_prima
snapshot_entities: !input target_light
mode: queued
max: 10
can you help me? I need to check the timer state.
Thank you