Motion/LUX activated lights not working

Hello, i’m new to HA and therefor have a simple (or so I thought) motion and LUX activated light.
Below a given LUX level the light is supposed to turn on based on identified motion in the room. Does not work.
I’ve tried two different motion sensors and LUX sensors.
I’m not familiar with traces, so do not understand the error messages it is sending, see below. Perhaps someone can help me interpret these messages?

Executed: February 9, 2025 at 08:39:54
Error: In 'not': In 'state': In 'state' condition: unknown entity input_select.home_mode
conditions/0
[Error in describing condition: Cannot read properties of undefined (reading 'entity_id')]
Executed: February 9, 2025 at 08:39:54
Error: In 'state': In 'state' condition: unknown entity input_select.home_mode
conditions/0/entity_id/0
[Error in describing condition: Cannot read properties of undefined (reading 'entity_id')]
Executed: February 9, 2025 at 08:39:54
Error: In 'state' condition: unknown entity input_select.home_mode
entity: input_select.home_mode

At first sight, input_select.home_mode doesn’t exist.
If it does, please post your automation

Hello, yes that made me suspicious also, but i don’t have a paramter that is named this, as far as i know. I do not know why this is in there.

alias: Office-Motion-activated Light with Lux Sensor
description: Downloaded from speakto the geek
use_blueprint:
  path: UpdatedsOckhamSter/motion_light_lux.yaml
  input:
    motion_entity:
      - binary_sensor.office_occupancy764_occupancy
    light_target:
      - light.office_desk_lamp
      - light.officevitrine55f0
      - switch.petraofficedesk53de
    illuminance_entity: sensor.philipshousefrontsensor513e_illuminance
    lux_trigger_value: 31447

It’s part of the blueprint for whatever reason/purpose:

Ok, thanks. how can i delete this portion?

Delete the condition in your local copy, in /config/blueprints

Ok, now i’m really confused. As sain, i’m a beginner.
But the script you sent was not the yaml file i posted, or? Is so, why did i now see this portion (input_seletc…) in my yaml file?
And, what precisely should i delete?

Just the one line: entity_id: input…

or more?
Sorry, for asking such noob questions.

You use a blueprint to define your automation (see “use_blueprint” in your original post).

Blueprints (think of it as templates for automations) are stored locally in the directory I mentioned above.

I linked to what I think is where you got the blueprint from (you have installed it yourself at some point)

You have to edit the blueprint to remove the reference to the entity you don’t have, so remove the “condition:” block.

As of a few releases ago, you don’t need to mess around in that directory to edit a blueprint for a particular automation.
Simply open up the automation page where the blueprint is in use > click the 3 dot menu at the top right > choose “Take Control”.
This lets you edit the blueprint right in the GUI

1 Like

Hello and thanks.
So learned now that when i import blueprints it’s not just the text or yaml that gets imported, but a link back to where the blueprint was found, with some additional entries?
These entries were not mentioned in the video i watched, so i thought it was a simple way to get such an automation.
If I now need to begin editing in yaml, which as a noob i’m struggling with, it makes the benefit of the blueprint a bit useless.

My original objective was an automation that turns on lights based on movement and max lux level.
I have another automation that i’m playing with that is supposed to do the same, but in that one the lights turn off, even when motion is still there and the room is below max LUX.

Perhaps there is a easy error here:

alias: Office Light Motion Lux control
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.office_occupancy764_occupancy
    from: null
    to: "on"
conditions:
  - type: is_illuminance
    condition: device
    device_id: 08b00cb685dfc8dbd2939866a1cac729
    entity_id: 284b4a8a3524c32bcb0360373c47fc35
    domain: sensor
    below: 3000
actions:
  - alias: Turn on the light
    action: light.turn_on
    data:
      kelvin: 3304
      brightness_pct: 59
      transition: 2
    target:
      entity_id:
        - light.officevitrine55f0
        - light.office_desk_lamp
        - light.petraofficedesk53de
  - alias: Wait until there is no motion from device
    wait_for_trigger: []
    continue_on_timeout: false
    timeout:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - alias: Wait the number of seconds that has been set
    delay:
      hours: 0
      minutes: 3
      seconds: 0
  - alias: Turn off the light
    action: light.turn_off
    data:
      flash: short
      transition: 5
    target:
      entity_id:
        - light.office_desk_lamp
        - light.officevitrine55f0
        - light.petraofficedesk53de
mode: restart
max_exceeded: silent

From a quick test, “taking control” means extracting a full-fledge automation from the blueprinted one, right?
So you’re not actually editing the blueprint, but creating an automation that doesn’t use the blueprint.

Yep indeed. You’re basically creating an automation with the blueprint as a starting point.
Same as using a regular blueprint, but fully customisable per automation. Quite handy when needing to create a bunch of automations based off the same blueprint, each with different mandatory inputs.

1 Like

yes but, if i’m only editing in the visual editor i do not even see the kind of entry that is causing a problem in my case. It was only visible while editing in yaml, which as a noob i’m avoiding doing.

Do as ShadowFist said

Then you’ll be able to remove the condition in the UI

You need to fix this part too ^^

If you want the light to turn back off when motion has no longer been detected, then you need to define an actual trigger in the wait_for_trigger part and set continue_on_timeout to true.

Ok, thanks all for the help.
I think i need to start with something even much simpler…i’m losing the sight for the forest due to all the trees.
I’ll come back to this one later when i’ve learned a few more fundamental things.
Somehow i keep running into one problem after another, and thougth that blueprints would be the “no brainer” of how to start with automations…
I just wanted to turn some lights on and off based on motion and max LUX level.