💡 Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@Ahrens7640

This should not happen. I tested it here and the lights still turn ON just the one that is unavailable is not asked to do anything.

Blacky :grinning:

Hi @Blacky,
three days into the new worksweek I can say, that I don’t have any issues anymore with the dynamic lights :+1:They turned on and off as expected :slightly_smiling_face:
Thank you for your great work :partying_face:

I might come to you again for questions to the night lights. But before that, I will think about it a little more :wink:
kind regards

@BastiKA84

Thanks for getting back to us… not many people do, so it’s really nice to hear it’s now working! I ended up spending around 14 to 16 hours on it, but it was worth it. Now I can replicate this into the Smart Light blueprint.

Again thanks for letting us know :+1:

Blacky :grinning:

1 Like

I just wanted to let you know that I’ve developed a :airplane: Holiday & Away Lighting blueprint that’s perfect for those times when you’re heading off on vacation or even just out for the evening.

It’s something I really recommend setting up and trying out before you actually need it. That way, you can test it, tweak it, and make sure it works exactly how you want… without the stress of setting it up last minute.

It’s not just practical, it’s also a lot of fun to play around with, especially if you enjoy tinkering with your home automations like I do. You can get creative with how your lights turn ON and OFF, link different rooms together, and build something that really fits your home and your routine.

Even if you’re not going away just yet, setting it up while you’re home gives you time to fine-tune everything and make sure it works just right. So when the time comes, you can simply flip it on and head out the door… knowing it’s all working behind the scenes.

I hope you have fun experimenting with it! And as always, I’d love to hear any feedback… whether it’s a suggestion, a bug report, or just a quick message to say it’s working well for you. Feel free to share your setups, ideas, or improvements with the community too within the actual blueprint thread, so we can all stay on topic and keep everything in one place.

Link to blueprint :airplane: Holiday & Away Lighting

Enjoy

Blacky :grinning:

2 Likes

Hi there,

i have the problem that the Ambient Control is not working for me. My intention is that the lights turn off if LUX reach 150 and turn on when LUX is 10. But nothing happens. What is my mistake?

Regards

Johannes

@Blacky I keep getting this error in. my logs

Logger: homeassistant.helpers.script
Source: helpers/script.py:697
First occurred: 25 April 2025 at 16:49:55 (2 occurrences)
Last logged: 25 April 2025 at 17:18:03

Error in 'choose[1]' evaluation: In 'or' (item 4 of 5): In 'template' condition: TypeError: unhashable type: 'list'

alias: Kitchen Motion Light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.kitchen_motion_sensor_occupancy
    include_sun: sun_disabled
    time_delay: 1.5
    end_scenes:
      - scene.kitchen_motion_light_off
    include_night_lights: night_lights_disabled
    light_switch:
      entity_id: scene.kitchen_motion_light_on
    sun_elevation: -2
    light_transition_on: 1
    include_bypass:
      - bypass_enabled_turn_on
    motion_bypass_lights_on:
      - light.kitchen_lights
    ambient_light_sensor: sensor.kitchen_motion_sensor_illuminance
    ambient_light_options: ambient_light_option_enabled
    include_ambient: ambient_enabled
    ambient_light_value: 25
    ambient_light_high_value: 40
    light_transition_off: 5

@johannes.hoelzle

Everything is working here. The only thing I can think of is your using a scene or a script and you haven’t enter in a toggle helper into the lights section Scenes & Scripts - Toggle Helper.

Blacky :grinning:

@andyblac

Hi Andy,

I have tested your YAML and I can reproduce the error log but it looks like you pushed a button for the Shelly.

PS: I am on the latest version and I did change one condition for night lights. Are you on the latest version?

Blacky :grinning:

I was on 8.0 must have missed the 8.1 update, I’ll test tonight see if still happens, and yes I turn off my Kitchen Lights via the wall switch, there are controlled by a shelly1.

update:

just tried the light and yes, it still happens of version 8.1, interesting though it only happens when it use the physical switch, if I turn on/off the Kitchen Light via HA button it does not report the error.

another thing I noticed, when using the HA Button the scene Kitchen motion Light Off actions right away when tuning off the Kitchen Light, but if I use the physical switch, it delays actioning the scene, but does action after a while.

Logger: homeassistant.helpers.script
Source: helpers/script.py:697
First occurred: 14:17:05 (1 occurrences)
Last logged: 14:17:05

Error in 'choose[1]' evaluation: In 'or' (item 4 of 5): In 'template' condition: TypeError: unhashable type: 'list'

Using physical switch:

it looks like it actions the scene after 1.5mins (aka the timeout delay), so might be intended result.

Using HA Button:

I was looking into the logs of HA for something. And I found this very large error, which tells me, that in line 28xx something is not working, and therefore someting else is not working… But it does not mention if it is a spefic automation of mine, or if it is the blueprint itself. My guess is, that it is the blueprint.

Logger: homeassistant
Quelle: helpers/template.py:646
Erstmals aufgetreten: 14:44:37 (1 Vorkommnisse)
Zuletzt protokolliert: 14:44:37

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2385, in forgiving_float_filter
    return float(value)
ValueError: could not convert string to float: 'unavailable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 644, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2904, in _render_with_context
    return template.render(**kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2388, in forgiving_float_filter
    raise_no_default("float", value)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1942, in raise_no_default
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}
  {% set bv = dynamic_lighting_max_brightness %}
{% elif lux >= dynamic_lighting_max_lux %}
  {% set bv = dynamic_lighting_min_brightness %}
{% else %}
  {% set bv = ((slope * lux) + ak) | round(1) %}
{% endif %} {% if lp <= 0 %}
  {% set bv = bv %}
{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}
  {% set bv = dynamic_lighting_max_brightness %}
{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}
  {% set bv = dynamic_lighting_min_brightness %}
{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}
  {% set bv = lp %}
{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}
  {% set bv = lp %}
{% elif bv > (lp + dynamic_lighting_step_value) %}
  {% set bv = lp + dynamic_lighting_step_value %}
{% elif bv < (lp - dynamic_lighting_step_value) %}
  {% set bv = lp - dynamic_lighting_step_value %}
{% endif %} {{ bv | round(0) }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/trace.py", line 283, in async_wrapper
    await func(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 664, in _async_step_parallel
    raise result
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in async_run_with_trace
    await self._async_run_script(script, parallel=True)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 632, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1827, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 715, in _async_step_choose
    await self._async_run_script(script)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 632, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1827, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/trace.py", line 283, in async_wrapper
    await func(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 938, in _async_step_repeat
    await self._async_do_step_repeat()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 894, in _async_do_step_repeat
    await async_run_sequence(iteration)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 790, in async_run_sequence
    await self._async_run_script(script)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 632, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1827, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 972, in _async_step_variables
    self._action[CONF_VARIABLES].async_simple_render(self._variables)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script_variables.py", line 81, in async_simple_render
    rendered_variable = template.render_complex(value, run_variables)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 267, in render_complex
    return value.async_render(variables, limited=limited, parse_result=parse_result)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 646, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}
  {% set bv = dynamic_lighting_max_brightness %}
{% elif lux >= dynamic_lighting_max_lux %}
  {% set bv = dynamic_lighting_min_brightness %}
{% else %}
  {% set bv = ((slope * lux) + ak) | round(1) %}
{% endif %} {% if lp <= 0 %}
  {% set bv = bv %}
{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}
  {% set bv = dynamic_lighting_max_brightness %}
{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}
  {% set bv = dynamic_lighting_min_brightness %}
{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}
  {% set bv = lp %}
{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}
  {% set bv = lp %}
{% elif bv > (lp + dynamic_lighting_step_value) %}
  {% set bv = lp + dynamic_lighting_step_value %}
{% elif bv < (lp - dynamic_lighting_step_value) %}
  {% set bv = lp - dynamic_lighting_step_value %}
{% endif %} {{ bv | round(0) }}' but no default was specified

OK, it might be the lux controlled “Arbeitslicht”. But right now, it is working. The light turn on and off and gets lighter or darker. So for me it is ok, but maybe not for the engineer behind it :slight_smile:

Logger: homeassistant.components.automation.arbeitslicht
Quelle: helpers/script.py:2057
Integration: Automation (Dokumentation, Probleme)
Erstmals aufgetreten: 14:42:30 (4 Vorkommnisse)
Zuletzt protokolliert: 14:44:37

Arbeitslicht: Choose at step 1: default: Parallel actions for dynamic lighting and normal lights: parallel 1: Choose at step 3: 1 - Dynamic Lighting - Lux Controlled Brightness: Dynamic Lighting Control: Error executing script. Error rendering template for variables at pos 1: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %} {% set bv = dynamic_lighting_max_brightness %} {% elif lux >= dynamic_lighting_max_lux %} {% set bv = dynamic_lighting_min_brightness %} {% else %} {% set bv = ((slope * lux) + ak) | round(1) %} {% endif %} {% if lp <= 0 %} {% set bv = bv %} {% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_max_brightness %} {% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_min_brightness %} {% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif bv > (lp + dynamic_lighting_step_value) %} {% set bv = lp + dynamic_lighting_step_value %} {% elif bv < (lp - dynamic_lighting_step_value) %} {% set bv = lp - dynamic_lighting_step_value %} {% endif %} {{ bv | round(0) }}' but no default was specified
Arbeitslicht: Choose at step 1: default: Parallel actions for dynamic lighting and normal lights: parallel 1: Choose at step 3: 1 - Dynamic Lighting - Lux Controlled Brightness: Error executing script. Error rendering template for repeat at pos 1: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %} {% set bv = dynamic_lighting_max_brightness %} {% elif lux >= dynamic_lighting_max_lux %} {% set bv = dynamic_lighting_min_brightness %} {% else %} {% set bv = ((slope * lux) + ak) | round(1) %} {% endif %} {% if lp <= 0 %} {% set bv = bv %} {% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_max_brightness %} {% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_min_brightness %} {% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif bv > (lp + dynamic_lighting_step_value) %} {% set bv = lp + dynamic_lighting_step_value %} {% elif bv < (lp - dynamic_lighting_step_value) %} {% set bv = lp - dynamic_lighting_step_value %} {% endif %} {{ bv | round(0) }}' but no default was specified
Arbeitslicht: Choose at step 1: default: Parallel actions for dynamic lighting and normal lights: parallel 1: Error executing script. Error rendering template for choose at pos 3: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %} {% set bv = dynamic_lighting_max_brightness %} {% elif lux >= dynamic_lighting_max_lux %} {% set bv = dynamic_lighting_min_brightness %} {% else %} {% set bv = ((slope * lux) + ak) | round(1) %} {% endif %} {% if lp <= 0 %} {% set bv = bv %} {% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_max_brightness %} {% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_min_brightness %} {% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif bv > (lp + dynamic_lighting_step_value) %} {% set bv = lp + dynamic_lighting_step_value %} {% elif bv < (lp - dynamic_lighting_step_value) %} {% set bv = lp - dynamic_lighting_step_value %} {% endif %} {{ bv | round(0) }}' but no default was specified
Arbeitslicht: Choose at step 1: default: Error executing script. Error rendering template for parallel at pos 4: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %} {% set bv = dynamic_lighting_max_brightness %} {% elif lux >= dynamic_lighting_max_lux %} {% set bv = dynamic_lighting_min_brightness %} {% else %} {% set bv = ((slope * lux) + ak) | round(1) %} {% endif %} {% if lp <= 0 %} {% set bv = bv %} {% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_max_brightness %} {% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %} {% set bv = dynamic_lighting_min_brightness %} {% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %} {% set bv = lp %} {% elif bv > (lp + dynamic_lighting_step_value) %} {% set bv = lp + dynamic_lighting_step_value %} {% elif bv < (lp - dynamic_lighting_step_value) %} {% set bv = lp - dynamic_lighting_step_value %} {% endif %} {{ bv | round(0) }}' but no default was specified

@BastiKA84

Looks like when your using dynamic lighting your lux sensor is unavailable. I contemplated if I should put a default value in but then it may not be the correct value and adjust the lights :thinking:

Blacky :grinning:

moving to the right thread, sorry about that

OK, thank you. What is funny, that it the automation is working as it should. :man_shrugging:

first of all, its the best blueprint in the web - great work!

second:
I face a odd issue that my “bypass helper” is not turned off after the selected
“Bypass Auto OFF Option”

the “Küche Blocker Helper” turns the lights on, but they stay “on” forever, same as the helper does. If i manually turn the helper off, the light goes off like it should.

I use the blueprint in a similar fashion with an option 2 blocker, so force light off - and this seem to work fine.

Blacky,

I notice the Bypass turn ON lights doesnt work with Night Lights. It seems to leave the lights at the night lights brightness. This doesnt seem to be expected behaviour, since the Bypass documentation above indicates it should work in any circumstance. Love your work.

Summary
alias: Ensuite Lights
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.md_master_bed_group
    light_switch:
      entity_id:
        - light.hue_ensuite_downlight_color
        - light.hue_color_lamp_1
        - light.hue_white_lamp_1
    include_bypass:
      - bypass_enabled_turn_on
    motion_bypass_lights_off: []
    ambient_light_sensor: sensor.hue_motion_sensor_1_illuminance
    ambient_light_options: ambient_light_option_enabled
    include_night_lights: night_lights_enabled
    night_lights_entity_state:
      - input_boolean.meinbed
      - input_boolean.wifeinbed
    night_lights_conditions:
      - entity_state_enabled
    night_lights:
      entity_id:
        - light.hue_color_lamp_1
        - light.hue_ensuite_downlight_color
        - light.hue_white_lamp_1
    night_time_delay: 2
    include_night_light_control:
      - use_brightness
      - use_transition
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 10
    night_light_transition_on: 0.5
    include_night_light_colour_control: disable_colour_control
    include_light_control:
      - use_brightness
    include_ambient: ambient_enabled
    motion_bypass_lights_on:
      - input_boolean.ensuite_lights_bypass
    include_bypass_auto_off: []
    bypass_auto_off_delay: 10

@BastiKA84

Well what ever it was, I glad it working for you.

Blacky :grinning:

@Krautmaster

Welcome to the community!

Thanks for your kind words.

Thanks for the screen shot that helps me. You have chosen bypass Option 1 so the auto OFF is Option A. You have selected auto OFF Option B. Please select Option A and you be good to go. See below.

Blacky :grinning:

@GeorgeCastanza

When the bypass is turned ON using option 1, the automation will turn ON the normal or night lights, depending on which is active at the time.

I have tested it here again and is working.

Blacky :grinning:

Is my yaml correct? it’s not working

alias: Ensuite Lights
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.md_master_bed_group
    light_switch:
      entity_id:
        - light.hue_ensuite_downlight_color
        - light.hue_color_lamp_1
        - light.hue_white_lamp_1
    include_bypass:
      - bypass_enabled_turn_on
    motion_bypass_lights_off: []
    ambient_light_sensor: sensor.hue_motion_sensor_1_illuminance
    ambient_light_options: ambient_light_option_enabled
    include_night_lights: night_lights_enabled
    night_lights_entity_state:
      - input_boolean.meinbed
      - input_boolean.wifeinbed
    night_lights_conditions:
      - entity_state_enabled
    night_lights:
      entity_id:
        - light.hue_color_lamp_1
        - light.hue_ensuite_downlight_color
        - light.hue_white_lamp_1