#damn it same thing
1 messages · Page 1 of 1 (latest)
it worked without the condition altogether.
wat
I also added variables, don't know if that helped...
condition is the main point of this blueprint...
and fixed the condition.
where can I see it
blueprint:
name: Custom Motion-activated Light
description: Turn on a light when motion is detected.
domain: automation
# source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
multiple: false
light_target:
name: Light
selector:
entity:
domain: light
multiple: true
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
input_bool:
name: Input boolean
description: Input boolean to read from
selector:
entity:
domain: input_boolean
multiple: false
input_state:
name: Input state
description: Input Bool state
default: on
selector:
boolean:
variables:
no_motion_wait: !input no_motion_wait
input_state_var: !input input_state
# 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: state
entity_id:
- !input input_bool
state: '{{ input_state_var }}'
# condition:
# - condition: state
# entity_id: !input input_bool
# state: '{{ input_state_var }}'
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: '{{ no_motion_wait_var }}'
- alias: "Turn off the light"
service: light.turn_off
target: !input light_target```
(line limits don't count in threads....) and I hate external links to code.
instead of working around the error with variables, i'd rather know the cause
that renders, didn't really test it.
no errors in logs?
nope
I think the formatting of the condition fixed it
try that without the variables.
condition:
- condition: state
entity_id: !input input_bool
state: "on"
but this is the regular format
I added the variables and that didn't fix it, I changed the syntax of the condition to match the HA docs and it rendered.
I blame you for peaking my curiosity to see why it didn't work and dropping what I was doing before...
I was basically trying to create something similar to this https://community.home-assistant.io/t/create-own-version-of-blueprint-motion-activated-light/280994/9
so
condition:
condition: state
entity_id: !input input_bool
state: "on"
instead of
condition:
- condition: state
entity_id: !input input_bool
state: "on"
fixed it lol