#hey i've just made a blueprint and it

1 messages · Page 1 of 1 (latest)

stiff plaza
#

can you paste your code here ?

timber plaza
#
blueprint:
  name: Motion-activated Light with Illuminance
  description: Turn on a light when motion is detected and room brightness is below threshold.
  domain: automation
  input:
    motion_entity:
      name: Motion Sensor
      selector:
        entity:
          filter:
            device_class: motion
            domain: binary_sensor
    illuminance_sensor:
      name: Illuminance Sensor
      selector:
        entity:
          filter:
            device_class: illuminance
            domain: sensor
    max_illuminance:
      name: Max Illuminance
      selector:
        number:
          min: 0
          max: 50_000
          unit_of_measurement: lx
          mode: box
    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: 120
      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: numeric_state
    entity_id: !include illuminance_sensor
    below: !include max_illuminance

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
#

@echo yew line 57 column 16

#

i didn't even see this tab

timber plaza
#

yeah i see it now

#

entity_id: !include illuminance_sensor

#

is the problem, not sure why though

echo yew
#

what does the error say?

#

oh that should be !input, not !include

timber plaza
#

i did !include, not !input