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

@GugZi

I don’t think there is a state for a trailer in HA.

Blacky :smiley:

Great blueprint man, love it. I was wondering if it is possible to use a multi-scene zigbee switch to change what scene is being used while you’re watching a movie etc? I would like to have a 4-way switch next to each of my couches/tv’s and be able to change the colours from the default scene.

@Scales82

You can as once the automation is triggered you can apply the sense and it will stay that way as long as you don’t use intermission… or you can use a script to apply the scene or lights. Example when this button is on then apply these lights, if this button is on then apply another set of lights. This way it will work with intermission :wink:

Blacky :smiley:

Lacks an important feature, during movie I don’t want any lights on, I only need turn off during and turn on after

@PilaScat

Just add your light in to Movie Lights and set the light % to 0.

Blacky :smiley:

1 Like

Thanks Blacky.
What if the button is a momentary button, not an on off switch. How would the script look? I’m not sure how you mean it’ll work with the intermission but the other way won’t? I may be confused a bit

i think so it don’t activate then content palying time is shorter then 5 or 10min

@Scales82

Option 1: Apply the Scene Manually While watching a movie, simply apply the scene you prefer. However, if you use the intermission option, you’ll need to reapply the scene when you resume the movie.

Option 2: Use a Script (More Advanced) You can create a script to handle this automatically. However, this approach is a bit more complex and requires a few considerations:

  1. Toggle Helpers for Scene Management
  • Create a toggle helper for each scene.
  • In each scene, turn ON the toggle helper for that scene and turn OFF the toggle helpers for the other scenes.
  1. Script Logic
  • In your script, use a “Choose” building block.
  • For each condition, check if the corresponding toggle helper is ON, and if so, activate the associated scene.
  • If you have only two scenes, you can use a default action for the second scene instead of adding more “Choose” options.
  1. Example Script Workflow
  • Step 1: Check which toggle helper is ON.
  • Step 2: Based on the toggle, activate the appropriate scene.
  • Step 3: Add more “Choose” actions if you have more than two scenes.

This setup allows the system to manage scenes automatically based on the toggle helpers, ensuring you don’t need to manually reapply them.

Blacky :smiley:

@GugZi

When you play a movie, the state is typically just “playing” or something similar. This same state is used during trailers, meaning Home Assistant (HA) cannot distinguish between trailers and the actual movie unless distinct states are provided.

If your system does offer separate states for trailers and movies, you can use those states in the blueprint automation. For instance, you could treat the trailer state as an “intermission” and adjust the lighting accordingly. However, without this differentiation, HA cannot determine whether a trailer or the movie is playing.

Blacky :smiley:

Hello
I’m using Shield TV
when trying to play Plex or Netflix (Chromecast) the automation did not work.

@dmob69

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:

alias: "Movie Night "
description: |-
  When Plex/Netflix is played after sun set 
  Lights will turn off- at Pause lights will turn on
  at the end Lights will turn on to 30%
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.family_room_tv_2
    trigger_on_state:
      - playing
    app_attribute:
      - Plex
      - Netflix
    trigger_off_state:
      - "off"
    time_delay: 5
    include_start_turn_off: enable_start_turn_off
    off_light_switch:
      entity_id: light.living_room_lights
    light_switch:
      entity_id: light.living_room_tv_light
    include_light_control:
      - use_brightness
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id: light.living_room_lights
    intermission_include_light_control:
      - use_brightness
    intermission_light_brightness: 10
    include_end_turn_on: disable_end_turn_on
    end_light_switch:
      entity_id: light.living_room_lights
    end_include_light_control:
      - use_brightness
    end_light_brightness: 30
    include_sun: sun_enabled
    sun_elevation: -1

@dmob69

Thanks for your YAML.

You had the wrong entity selected for your media player. Here is your correct YAML. Cut and paste it in and it should work.

alias: "Movie Night "
description: |-
  When Plex/Netflix is played after sun set 
  Lights will turn off- at Pause lights will turn on
  at the end Lights will turn on to 30%
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - media_player.family_room_tv
    trigger_on_state:
      - playing
    app_attribute:
      - Plex
      - Netflix
    trigger_off_state:
      - "off"
    time_delay: 5
    include_start_turn_off: enable_start_turn_off
    off_light_switch:
      entity_id: light.living_room_lights
    light_switch:
      entity_id: light.living_room_tv_light
    include_light_control:
      - use_brightness
    include_intermission: intermission_enable
    intermission_light_switch:
      entity_id: light.living_room_lights
    intermission_include_light_control:
      - use_brightness
    intermission_light_brightness: 10
    include_end_turn_on: disable_end_turn_on
    end_light_switch:
      entity_id: light.living_room_lights
    end_include_light_control:
      - use_brightness
    end_light_brightness: 30
    include_sun: sun_enabled
    sun_elevation: -1

Blacky :smiley:

perfect. Thank You!

1 Like

@Blacky This is awesome… I have a home theater and this combines multiple lighting automations into a single BP!

the section ‘Movie Lights’ says its required but I’m not understanding why that is needed. My ‘Trigger On’ is “Play” and thus I want all lights OFF… which is already set in “Lights Off at Start” section?

To make it easier to understand, I suggest changing the BP sections to use the same wording you have in your doc/info post; which is easier to understand IMO…
Movie Start (Play), Intermission (Pause), Movie End (Stop).

In my case with my current automation system, I actually have 6 ‘states’. I suspect many others do something similar:

  1. System On (Power On) : multiple lights go on to 50%
  2. Movie Start (Play) : all lights turn Off
  3. Intermission (Pause) : some lights to go 10%
  4. Movie End (Stop) : some lights to go 20%
  5. System Off (Power Off) : some lights go to 50%, then all turn off after 10 minutes
  6. Special Occasion (sets some lights to specific levels differently during Play, Pause, and Stop – light our 2nd row light stays at 10% while ‘Dinner scene’ toggle is On.

If you expand the BP functions please consider adding Power On, Power Off, and Special Occation.

‘Special Occasion Lighting’ is for situations when you want a little lighting for activities like eating.

a. Special Occasion Bypass Entity (Physical Switch and/or Helper)

b. When Bypass is turned On:
Lights you want on and to what level: on/off/dim, rgb color, etc
– can be multiple lights.
Example: 2nd row ceiling lights to 10% dim level & RGB LED strips to Blue, 20% dim level

c. When Bypass is turned Off: select BP State to revert to On or Off

2 Likes

@Ltek

Thanks for all your recommendations. I will put it on the list.

Blacky :smiley:

yes i have very similar setup and infact made a very similar request recently. in the end i use this BP for the movie playing and a automation the snapshots the entities i use for movie Mode (power on ) scene and restores them when i turn it off

1 Like

I have a problem, every now and then the turn on lights at the end doesn’t work, I use a switch
Trying to understand why but I don’t know

My config:

id: '1737382634130'
alias: Salotto - TV Lights
description: ''
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_bypass: switch.scatigna_pc
    trigger_entities:
      - media_player.tv_salotto_cast
    trigger_on_state:
      - playing
    trigger_off_state:
      - idle
      - 'off'
      - paused
      - standby
    include_start_turn_off: enable_start_turn_off
    include_bypass: bypass_enabled_pause_automation
    include_sun: sun_disabled
    sun_elevation: 5
    sun_elevation_rising: -10
    off_light_switch:
      entity_id:
        - switch.interruttore_salotto_lampadario
        - switch.interruttore_salotto_lampada
    intermission_light_switch:
      entity_id: switch.interruttore_salotto_lampada
    include_end_turn_on: enable_end_turn_on
    end_light_switch:
      entity_id: switch.interruttore_salotto_lampada
    time_delay: 1
    light_switch:
      entity_id: scene.empty_scene
    include_intermission: intermission_enable
    end_scenes: []

@PilaScat

Everything looks good. If this happens occasionally, it means the automation is working, but something else might be interfering at that moment. Based on your YAML, here are two possible things to check:

  1. Communication Failure: The connection to switch.interruttore_salotto_lampada may fail. If this happens, check the trace logs… you might see a warning or error indicating a communication failure.
  2. Bypass Activation: You have a bypass that pauses the automation using switch.scatigna_pc. Could it be ON at the time you’re trying to turn the lights back on? That would prevent the automation from running as expected.

Blacky :smiley: