Boas a Todos,
Estou com um problema (posssivelmente basico) com os Blueprint
Usando o Motion Detection como base, estou a tentar colocar uma condição basica… de se a luz selecionada estiver previamente ligada, ele não executa a automação … para evitar que ele esteja sempre sempre a desligar a luz quando eu a quero ligada (por switch)
blueprint:
name: Motion-activated Light test
description: Turn on a light when motion is detected.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
light_target:
name: Light
selector:
target:
entity:
domain: light
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 30
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
condition:
- condition: or
conditions:
- condition: state
entity_id: !input light_target
state: 'off'
action:
- alias: "Turn on the light"
service: light.turn_on
target: !input light_target
- alias: "Wait until there is no motion from device"
wait_for_trigger:
platform: state
entity_id: !input motion_entity
from: "on"
to: "off"
- alias: "Wait the number of seconds that has been set"
delay: !input no_motion_wait
- alias: "Turn off the light"
service: light.turn_off
target: !input light_target
e estou a obter o seguinte erro:
Blueprint Motion and brightness activated Light when not yet connected generated invalid automation with inputs
OrderedDict([('motion_entity', 'binary_sensor.xxxxxxx_occupancy'), ('brightness_entity', 'sensor.xxxxxx_illuminance_lux'), ('light_target', OrderedDict([('entity_id', 'light.xxxx')])), ('no_motion_wait', 20)]):
Entity ID entity_id is an invalid entity ID for dictionary value @ data['condition'][0]['conditions'][2]['entity_id']. Got None
Caso ponha na condição o light.xxxx ele funciona corretamente, mas por outro lado perde a vantagem de ser um blueprint…