♾ Sensor Light Add On - Media & Movie Lights - House Alarm Lights - Smoke Alarm Lights & Exhaust Fans + More

I’d like to use Dynamic Lighting (inverted lux) that takes lux value of a sensor in master bedroom and if dark, keeps lights dim in master bathroom. All fine and well until my wife does her makeup in the morning while I’m still sleeping - the lights are dim and she wants bright lights).

I have a door sensor on the door leading into the bathroom. I’d like to make it so that when the door is closed, the lights turn up to 100%, essentially ignoring dynamic lighting. When the door is opened, dynamic lighting is reengaged to turn the lights back to dim so as to not disturb whoever is sleeping.

Is that possible or could it be made possible?

Thanks for an awesome blueprint!

@tyjthomas

Yes it can. Have you looked at just using the sensor light blueprint and using night lights, and use the state condition. You will have to make a template binary sensor that inverts the state of your door so when it is closed it is ON and when it is open it is OFF. Then use that as your state condition in night lights. You could also include the time condition in night lights so when your wife does her makeup at X time and the door is closed (using your template binary sensor) then you activate night lights that are set to 100% brightness. Also make sure you select “If lights are ON, adjust the lights when crossing over” in night light control.

If you look at my template examples click here is shows you how to invert a binary sensor. See REF - TS-7

Or you can just us the template helper by going to Settings / Devices & Services / Helpers Tab at the top / Create Helper / Template / Binary Sensor / Enter in the name you would like to call it and set the device class to your liking and in “State Template” paste the code below replacing the ‘binary_sensor.your_door_sensor_here’ with your door entity ID’s

{{ is_state('binary_sensor.your_door_sensor_here', 'off') }}

Let us know if this works for you.

Blacky :smiley:

That’s a great idea. I have night mode set to a whole home toggle that goes on/off according to time of day but setting it to the light sensor makes more sense.

Is there a way to incorporate both the light illuminance and the door sensor together? I could always make a separate automation that turns the toggle on and off too which wouldn’t be hard.

Or maybe something like this in the template binary sensor:

{{is_state('binary_sensor.door_master_bathroom_status', 'off') and states('sensor.everything_presence_lite_2fbc58_illuminance_2')|float < 20 }} ```

Yes, that will work but remember when the light turns ON it can affect the lux sensor and if it goes above 20 then this template will show OFF.

Blacky :smiley:

I think this blueprint is really good. I can turn the light on in 3 different zones together using a motion detector and turn it off again after a defined time.
Now I have a special requirement: if the light has already been switched on manually in one of the 3 zones, it should not be switched off again via the timer.
I know that there is a bypass function. However, a sensor has to be used for this. But I don’t have this sensor.
Does anyone have an idea how to implement this so that only the light channel that is not active is switched?

Regards
Thomas

Sometimes the automation fails to run if say Netflix was running before the sun elevation value of -1.5 is meet. I can get it to run immediately by restarting the Apple TV entity, HA, or maually running the automation. What is causing it to hang sometimes? Should I create another automation to call service Apple TV restart at -1.6 elevation?

@kobejo34

I will need to look into this to see if there is a bug in it. I am going to work on this BP updating it soon so I will look into it then. I have some ideas what may be causing it. Thanks for letting us know :+1:

Blacky :smiley:

@kobejo34

I am working on this now… Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

This way I can test it all working.

Thanks for your help.

Blacky :smiley:

I have Lutron lights where to get lights to switch off together I need to create a set button within their hub. That button can then be seen in HA. For the lights, I have created 3 buttons - Lights On Day, Lights Off, Lights On Night. I then created 3 scripts with the same name. Each script simply pressing the button as well as adjusting one other non-Lutron light in the room.

For my automation config, I’m not seeing the scripts being activated and it seems that the trace shows the automations going thru the “else” route, bypassing things. I have toggles inputted and from what I’ve read I think I am doing it right but obviously not. I’m using Blueprint v7.0 and HA 2024.7.4. What am I missing?

Here is one of the scripts (other scripts are duplicates of this)

alias: Great Room Day On
sequence:
  - parallel:
      - service: light.turn_on
        metadata: {}
        data:
          kelvin: 3092
          brightness_pct: 100
        target:
          entity_id: light.lights_side_table_lamp_lamp
      - service: button.press
        metadata: {}
        data: {}
        target:
          entity_id: button.utility_phantom_keyapd_position_1_keypad_great_room_day_on
description: ""
mode: restart

Here is YAML of blueprint.

alias: Blacky - Great Room
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    night_boolean_scenes_scripts: input_boolean.great_room_toggle_night
    motion_trigger:
      - binary_sensor.great_room_motion_group
    light_switch:
      entity_id: script.great_room_day_on
    boolean_scenes_scripts: input_boolean.great_room_lights_on_toggle
    end_scenes:
      - script.great_room_day_off
    include_bypass:
      - bypass_enabled_stop
      - bypass_enabled_turn_on
    motion_bypass_lights_stop:
      - input_boolean.auto_lights_bypass_great_room_landing
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: script.great_room_night_on
    include_night_light_control:
      - manage_scripts_crossing_over
      - if_lights_are_on_adjust_when_crossing_over
    night_lights_conditions:
      - entity_state_enabled
    night_lights_entity_state:
      - input_boolean.night_toggle
    night_time_delay: 0
    time_delay: 0
    motion_bypass_lights_on:
      - binary_sensor.door_master_bathroom

It may be because I am calling for a script instead of a scene? I’m not sure then how to otherwise incorporate a button press as you can call that action through a script, but not a scene.

@tyjthomas

Thanks for reaching out.

Yep, scripts are not in this blueprint but I am working on this BP now so I will look to add them in.

Blacky :smiley:

That’d be awesome.

As I have read through massively long threads on your automation, you’re always happy to help and not condescending. It makes me love this blueprint 10x. Thank you.

@tyjthomas

Thanks for your kind words… it is all done and ready to go. Hope you like it.

Blacky :smiley:

New Update - Version 2.2

Lights, Camera, Action! Get ready to grab the popcorn because it’s movie time with a touch of cinematic magic! :clapper::sparkles:

:new: New Feature

  • Light Colour: You now have the option to select RGB, RGBW or RGBWW in your light control option.

  • Scripts: You can now use scripts.

  • Collapsible Sections - Added collapsible sections to the blueprint. This enhancement improves the blueprint user interface by making it cleaner and more organized, allowing sections to be collapsed.

    :warning: This feature was introduced in Home Assistant 2024.6, so you must have this version or later for the blueprint to work.

:bug: Bugs Fixed

  • Fixed bugs in bypass.
  • Fixed bugs in scenes.
  • Fixed bugs when crossing over to intermission and vice versa.
  • Fixed bug when using sun or ambient conditions.

:toolbox: Maintenance

  • Update the description.
  • Clean up code.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

Cool. Thanks. Would it be possible for you add scripts to the standard sensor light automation as well? I’ll move over to the sensor light automation thread.


Hi, looking to have Jellyfin for Android TV added to the list of apps. :slight_smile: Great blueprint, thanks very much!

@ZOXSOCKS

You can add Jellyfin in if your like. Just simply type the app name in and hit enter. This is the name you need to enter.

org.jellyfin.androidtv

Blacky :smiley:

@Blacky

Few questions,

I am trying to make the light turn off when the movie starts but they won’t turn off, the only thing I been able to do is set it to 1% and that works but when I use the start off option it won’t turn off.

Ideas?

Also is there a way to add an option to detect presence base kn an entity provided and if in that area it detects a presence to set the lights at a certain level or just don’t do anything to those lights… Thoughts?

@parallelsys

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Currently no.

Blacky :smiley:

Here You. :slight_smile:

alias: Roku Automation New
description: ""
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.roku_3800x_7ce2
    trigger_on_state:
      - playing
    app_attribute: []
    trigger_off_state:
      - idle
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id:
        - light.kitchen
        - light.kitchen_breakfast_light
    intermission_include_light_control:
      - use_transition
      - use_brightness
    intermission_light_brightness: 23
    intermission_light_transition_on: 2
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id:
        - light.living_room
        - light.receiving_lights
        - light.kitchen_breakfast_light
        - light.kitchen_lights
    end_include_light_control:
      - use_transition
      - use_brightness
    end_light_brightness: 21
    include_start_turn_off: enable_start_turn_off
    off_include_light_control:
      - use_transition
    light_switch:
      entity_id:
        - light.kitchen_breakfast_light
        - light.kitchen_lights
        - light.receiving_lights
        - light.living_room
    off_light_transition_off: 2
    include_light_control:
      - use_brightness
    light_brightness: 1

@parallelsys

Try setting the brightness to 0%

alias: Roku Automation New
description: ""
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.roku_3800x_7ce2
    trigger_on_state:
      - playing
    app_attribute: []
    trigger_off_state:
      - idle
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id:
        - light.kitchen
        - light.kitchen_breakfast_light
    intermission_include_light_control:
      - use_transition
      - use_brightness
    intermission_light_brightness: 23
    intermission_light_transition_on: 2
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id:
        - light.living_room
        - light.receiving_lights
        - light.kitchen_breakfast_light
        - light.kitchen_lights
    end_include_light_control:
      - use_transition
      - use_brightness
    end_light_brightness: 21
    include_start_turn_off: enable_start_turn_off
    off_include_light_control:
      - use_transition
    light_switch:
      entity_id:
        - light.kitchen_breakfast_light
        - light.kitchen_lights
        - light.receiving_lights
        - light.living_room
    off_light_transition_off: 2
    include_light_control:
      - use_brightness
    light_brightness: 0

Blacky :smiley:

1 Like