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

@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

@bluemonkeysuit07

You can use another entity to trigger it ON but if your use plex to pause then you will need the state change from plex back to playing to resume it… so then why not just use plex… test it and see if it works.

Blacky :smiley:

because i want to prepare the room before the media starts playing ( close shutters lower the projector screen, turn on projector etc). I guess i need to have 2 automations or roll my own in this case. I just need to learn how to remember entities states before activation so at the end of movie watching they return to their previous states

I found out there’s a HACS add-on for stateful scenes, but it seems it is applied to all scenes when installed. but i only want/need to remember states for this one scene. can anyone recommend the best solution for my situation or has similar setup?

@bluemonkeysuit07

So you can use an entity to start it and then use the plex to take over. Try using an entity with the ON state. Then in the Trigger - OFF State don’t put a OFF state and only use what state your plex go into.

Or just use your plex get the movie ready and hit pause. Then you will have intermission lights and be all ready to walk in.

Use the Enable to create a snapshot - Lights - Switches in Lights ON at End. It will record all your light for you and then return them to your previous states / settings.

Blacky :smiley:

Hello Blacky,

Thank you for great Blueprint (and others as well).

I have a strange issue. I’m trying to use a snapshot to restore previous state of the light in the room. The room light is a dimmer, so it restores the brightness. I have a dashboard with Light card widgets where I can see/control brightness and on/off the light.
The problem I have is - when I press the pause button on the remote, playback pauses, and the widget shows, that the brightness of the light sets to the previous value, but the actual light remains at the brightness supposed to be at movie playback.
If I choose not to use a snapshot, but set a brightness to certain level, it works great. So it seems the snapshot mechanism does not affect actual hardware somehow.

Do you have any suggestions of where to look at and/or how to debug this?

Thanks!

@ifel

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.

Blacky :smiley: