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

When the automation switches to Intermission mode, is the Movie Lights Scenes & Scripts To Turn OFF executed? I have a scene to close a blind when the automation starts and configured in the Movie Lights section. I also have a script to reset it to its calculated position for the time of the day when the automation exists. However, when entering Intermission mode, the script to reset the blind is executed and blind opens. Is that normal behaviour?

@paf1

Can you try this for me.

Keep this.

Can you move this script to End Turn ON - Lights - Switches - Scenes - Scripts

Let us know if this works for you.

Blacky :smiley:

Just installed this today, thank you for it Blacky.
Wondering if anyone has had success disabling the Adaptive Lighting integrations by Basnijholt, when this runs?

Update: Sorted - I just added off/on in my scenes instead.

@Gosnid

Nice one… glad you worked it out and thanks for the edit letting us know :+1:

Blacky :smiley:

Would it be possible to have multiple bypass “switch” methods. For instance if the switch pool is on, the binary sensor group xyz is on, or switch group abc is on I’d like to bypass this automation and I can not for the life of me figure out how to combine binary sensor and switches in the same on/ off or how to check if all three are in a certain state.

@kobejo34

I will add it to the list to do.

Blacky :smiley:

Will this blueprint work with plex? currently i have an automation setup that pretty much does this but only triggers when a movie is playing from the library “Movies”. Interested in this because it could streamline a few other things i have going on.

@RogerB1

I cant see why not, try it out and see how you go.

Blacky :smiley:

some apps while playing a movie on the developer it shows paused

@aelsharawi

That is not good. It will be a communication issue between the App and HA.

What App is it and can you contact the App developer?

Blacky :smiley:

Hey Blacky,
I’ve been trying to get this Blueprint to work, but the lights aren’t turning off when Plex starts playing. I have the Plex integration and I see in the logbook it shows as playing / paused etc. (screenshot included) I’ve even run the blueprint manually and it’s not doing anything, not sure what I’m missing, the traces show no activity (When I do a run action) I’m also using the bypass since I’m using your Sensor Light Blueprint for this room as well. Here is the code:

Edit: In the homeassistant.log file I’m getting this error: 2024-12-22 15:22:35.720 ERROR (MainThread) [homeassistant.components.automation.home_theater_watching_movies_light_automation] Error rendering variables: UndefinedError: ‘list object’ has no attribute ‘entity_id’

alias: Home Theater - Watching Movies Light Automation
description: This Automation turns on/off the lights when watching Plex
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.plex_plex_for_android_tv_shield_android_tv_2
    trigger_on_state:
      - playing
    trigger_off_state:
      - "off"
      - standby
      - idle
    include_start_turn_off: enable_start_turn_off
    off_light_switch:
      entity_id:
        - light.home_theater_main_lights
        - light.bar_main_lights
    off_include_light_control:
      - use_transition
    off_light_transition_off: 3
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id: light.home_theater_main_lights
    intermission_include_light_control:
      - use_brightness
      - use_transition
    intermission_light_brightness: 15
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id: light.home_theater_main_lights
    end_include_light_control:
      - use_brightness
      - use_transition
    end_light_brightness: 50
    end_light_transition_on: 5
    include_automation_link: enable_automation_link
    automation_link:
      - input_boolean.automation_link_media_movie
    app_attribute: []

2024-12-22_15-13-48
Here is the Bypass for the Senor Light BluePrint

Thank you

Thanks for the blueprints!!! Great additions!
Ive been doing some UV automation for lights and your Sensor Light is perfect. If I see a good place to add in UV or Lux into it ill let you know!

Thanks again!

@DaAliG

Movie lights are required but because you would like them OFF I set the % to 0. Not sure what the automation link is doing so you will have to make sure that is correct. See code below… copy paste it in replace you YAML

alias: Home Theater - Watching Movies Light Automation
description: This Automation turns on/off the lights when watching Plex
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.plex_plex_for_android_tv_shield_android_tv_2
    trigger_on_state:
      - playing
    trigger_off_state:
      - "off"
      - standby
      - idle
    include_start_turn_off: enable_start_turn_off
    off_light_switch:
      entity_id:
        - light.home_theater_main_lights
        - light.bar_main_lights
    off_include_light_control:
      - use_transition
    off_light_transition_off: 3
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id: light.home_theater_main_lights
    intermission_include_light_control:
      - use_brightness
      - use_transition
    intermission_light_brightness: 15
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id: light.home_theater_main_lights
    end_include_light_control:
      - use_brightness
      - use_transition
    end_light_brightness: 50
    end_light_transition_on: 5
    include_automation_link: enable_automation_link
    automation_link:
      - input_boolean.automation_link_media_movie
    app_attribute: []
    light_switch:
      entity_id:
        - light.home_theater_main_lights
    include_light_control:
      - use_brightness
    light_brightness: 0

Blacky :smiley:

1 Like

@Blacky As always thank you so much for the help, it’s working now, can’t believe I missed that, I knew I was missing something. One last question, and sorry if someone asked this before but I couldn’t find anything. On the “Lights on at End”, when I stop playback, it turns off the automation and reverts back to your other blueprint Sensor Light, which turns the lights back on to 100%, I thought in the lights on at end if I set the Brightness to 50% with 5 seconds transitions it would use that brightness/transition, is there a way when the movie ends (or hit stop) that the lights transition on slowly instead of BAM lights 100% :slight_smile:

@DaAliG

No problem you welcome.

Good point, I will have to fix this. I think this is because I fixed the sensor light blueprint bypass. Keep an eye out for a new release.

Blacky :smiley:

New Update - Version 2.3

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

  • Automation Link - Time Delay: When you stop the media player, you can use the Lights ON at End option to set the lights to a comfortable brightness… say, 50%. After the Time Delay has passed, the automation link turns OFF, handing control back to your primary light automation (Sensor Light Blueprint), which might restore the lights to full brightness (e.g., 100%). This gradual transition gives your eyes time to adjust, creating a smoother shift from movie mode back to your regular lighting and enhancing the overall user experience.

:bug: Bugs Fixed

  • Fixed bugs in bypass.
  • Fixed light flicker in end lights

:toolbox: Maintenance

  • From time to time, Home Assistant updates their YAML standards and coding practices. To align with their roadmap, we’ve updated the code accordingly. We will continue to apply these updates across all our blueprints as they are revised.

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:

1 Like

Hi Blacky,
For some reason the Automation link - Time Delay is still not working for me. When I stop the player the lights go back on and the Sensor Automation kicks in immediately. Let me know if I need to provide any other trace / log.

Thank you!!

id: '1734815132923'
alias: Home Theater - Watching Movies Light Automation
description: This Automation turns on/off the lights when watching Plex
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.plex_plex_for_android_tv_shield_android_tv_2
    trigger_on_state:
      - playing
    trigger_off_state:
      - 'off'
      - standby
      - idle
      - unavailable
    include_start_turn_off: enable_start_turn_off
    off_light_switch:
      entity_id:
        - light.home_theater_main_lights
        - light.bar_main_lights
    off_include_light_control:
      - use_transition
    off_light_transition_off: 5
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id: light.home_theater_main_lights
    intermission_include_light_control:
      - use_brightness
      - use_transition
    intermission_light_brightness: 20
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id: light.home_theater_main_lights
    end_include_light_control:
      - use_brightness
      - use_transition
    end_light_brightness: 30
    end_light_transition_on: 5
    include_automation_link: enable_automation_link
    automation_link:
      - input_boolean.automation_link_media_movie
    app_attribute: []
    light_switch:
      entity_id: light.home_theater_main_lights
    include_light_control:
      - use_brightness
    light_brightness: 0
    intermission_light_transition_on: 5
    intermission_light_transition_off: 5
    time_delay: 3

When I hit stop, here is th trace Timeline:


Triggered by the state of media_player.plex_plex_for_android_tv_shield_android_tv_2 at December 29, 2024 at 10:27:07 AM
Test If any of 8 conditions matches
Test If any of 5 conditions matches
Test If any of 7 conditions matches
Test If any of 4 conditions matches
Test If any of 10 conditions matches
Choose: No action executed
Choose: No action executed
Choose: Check turn off lights & switches is enabled and turn off lights that are on
Choose: Check trigger intermission is enabled and turn intermission lights off
Choose: Check if automation link is enable
(input_boolean.automation_link_media_movie) turned on
Choose: No action executed
Perform action 'Light: Turn on' on templated entities
Choose: If transition is not selected
Turn on the switches
Turn on the scripts
Choose: No action executed
Wait until trigger is off
1 minute later
Wait the number of seconds set in the time delay
3 seconds later
Choose: If transition is not selected
Turn off the switches
Turn on the scripts
Choose: Check if end turn ON is enable & option Enable to turn ON - Lights - Switches - Scenes
Choose: No action executed
Choose: Check if automation link is enable
(input_boolean.automation_link_media_movie) turned off
(light.home_theater_main_lights) turned on
Finished at December 29, 2024 at 10:28:16 AM (runtime: 68.81 seconds)

@DaAliG

You just need to enable it and set the time delay you would like. See below.

Blacky :smiley:

omg, I could’ve sworn I had that enabled. Good Grief, Sorry for such a stupid mistake Blacky, you’re the best! Happy New Year!

1 Like

"Would it be possible to add the ability to activate Intermission with a different entity than the trigger?
Reason: I use a toggle helper to start trigger this automation, but want to use Plex paused to trigger Intermission.

As I am integrating this scene with the Light Sensor scene for the same room, the lights that this scene controls are already on, and this scene needs to turn them off for movie watching. I couldn’t save this scene without entering an entity into ‘Lights - Switches - Scenes *’. I don’t want any additional lights to turn on, only the ones that Sensor Light scene has already turned on to turn off."

Was there a solution for this?. Ideally for me there would be a “start” step before the 'media playing" step and a 'stop" step after the “media stopped” step that sets the scene before playing the media and optionally restore entities when stopped