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

Hi!

I would like to test if this blueprint can replace an automation I made for my DIY alarm but I need an info first.

My alarmo (a great custom component) has the following statuses:

disarmed|The alarm is disabled/off.
arming|The alarm is arming.
armed_away|The alarm is armed in away mode.
armed_home|The alarm is armed in home mode.
armed_night|The alarm is armed in night mode.
armed_vacation|The alarm is armed in vacation mode.
armed_custom_bypass|The alarm is armed in custom mode.
pending|The alarm is pending.
triggered

In the automation I see for trigger on state just a generic on and playing. Is that generic on will work also with the alarm statuses like triggered?

Moreover can add a feature to be able to set non only color temperature but RGB colors? If it can be used with alarm system I think it should allow to turn light with a 100% RED status do you agree?

I will look into this more as I would like to have an input where you can put in anything you like (costume input) rather than trying to accommodate every integration.

Agree but there are a few ways to do this and not every RGB are the same. The best way to do this is to create a scene and set the colour temp then enter the scene in.

EDIT: This has been done… I will need to test it before I release an update.

1 Like

great!

Regarding RGB ok. I just wonder if I have to create as many scenes for every light I have to include right?

I’m asking because I was thinking to use this blueprint to replace an automation that, based on room occupancy, save light status, change light to a default color (pink) and the restore previous details (status, brightness, color).

It doesn’t work 100% of the time, mainly because of my poor developer skills.

To restore to the previous details use the “Snapshot” option :wink:

I will see if I can get some time in the next 2 days to test it. Thanks for being patient

oh ti would be great. I’ll share here my version (one automation to manage multiple rooms):

alias: "Babymonitor : Notifiche Visive"
description: ""
trigger:
  - entity_id:
      - sensor.foscam_1_motion
    platform: state
    to: Detected
    id: Motion
  - entity_id:
      - sensor.foscam_1_sound
    platform: state
    to: Detected
    id: Sound
condition: []
action:
  - parallel:
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_cucina_occupancy
            state: "on"
        then:
          - variables:
              scene_id: cucinaprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.striscia_led_cucina_rgb
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
            target:
              entity_id: light.striscia_led_cucina_rgb
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_soggiorno_occupancy
            state: "on"
        then:
          - variables:
              scene_id: soggiornoprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.striscia_led_divano
                - light.striscia_led_libreria
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
            target:
              entity_id:
                - light.striscia_led_divano
                - light.striscia_led_libreria
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_bagno_principale_occupancy
            state: "on"
        then:
          - variables:
              scene_id: bagno_principaleprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.striscia_led_bagno_principale
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
            target:
              entity_id:
                - light.striscia_led_bagno_principale
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_bagno_secondario_occupancy
            state: "on"
        then:
          - variables:
              scene_id: bagno_secondarioprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.striscia_led_bagno_secondario
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
            target:
              entity_id:
                - light.striscia_led_bagno_secondario
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_studio_occupancy
            state: "on"
        then:
          - variables:
              scene_id: studioprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.lampada_scrivania
                - light.jack_lamp
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
            target:
              entity_id:
                - light.lampada_scrivania
                - light.jack_lamp
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
      - if:
          - condition: state
            entity_id: binary_sensor.ep1_camera_da_letto_occupancy
            state: "on"
        then:
          - variables:
              scene_id: cameradalettoprima{{ now().timestamp() | int }}
          - service: scene.create
            data:
              scene_id: "{{ scene_id }}"
              snapshot_entities:
                - light.comodini
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - service: light.turn_on
            data:
              rgb_color:
                - 255
                - 128
                - 192
              brightness_pct: 1
            target:
              entity_id:
                - light.comodini
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - service: scene.turn_on
            data: {}
            target:
              entity_id: scene.{{ scene_id }}
        enabled: false
mode: queued
max: 10

New Update - Version 1.6

Upgrade :new:

Upgrade the state selection. Now if your state is not shown in the list you can add custom states. To add a custom state just simply type the state you would like into the input and hit enter. To delete a state click on the “X” next to it.

:warning: BLUEPRINT CODE UPDATE :exclamation:

Just a heads up if your still on a old HA version before you update.

From time to time Home Assistant update their code structure and the old code will become “DEPRECATED” stopping / breaking automations from working. It effected this blueprint about 4 to 6 months ago. I wanted to wait some time so everyone had a chance to update their HA version before updating the code as older HA versions can not run the new code. This blueprint has now been updated so it will still operate once HA remove the “DEPRECATED” code from their system. :wink: :+1:

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:

Hi @Blacky

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.

Also, it would be great to include other room actions such as putting the blinds down and turning the projector on.

Thanks for you help.
G.

Another question.
How do I use this automation to manage multiple ‘modes’ per room?
For example my Lounge needs to respond to Movie Mode, which I have configured first. But then there is also TV Mode, Housework, and Party.
Is it possible to have triggers and different light settings for these other modes too?

@clowgg

What happens when you ad both into the trigger?

You cant save a scene.

Then create a scene with them OFF (you probably have this already) and enter it in to “Lights - Switches - Scenes”.

I will add this to the list.

You probably have to create a different automation fro each mode you like.

Blacky :smiley:

I’ll try that now.

I meant ‘automation’

Done that - great idea! :slight_smile:

I can of course have a scene that turns my projector on and drops the blinds. Could this be the scene I set in “Lights - Switches - Scenes”?

Would that be a different ‘Sensor Light Add On - Media & Movie Lights’ automation?
Can I link more than one of these to the same ‘Sensor Light’ scene? Would the ‘The Automation Link Option’ still work?

Yep you can. or you can add 2 scenes or 3 scenes etc it is totally up to you.

Not sure why or what you are trying to do with so many different options. You will just have to try it out and see what works best for you.

I’ve made some changes to the config, Still testing.
One question for now.
Should the lights turn off when the time Time Options End Time passes? I thought they would, but I’m not seeing that. Is it because I am not using a motion sensor Trigger in this room, but rather a Time of Day helper?

What happens is that when I stop the TV show on Plex, the TV turns off and the lights go back to how they were prior. This isn’t what I want (TV turning off) of course :smile:

This is the config:

alias: Lounge TV Mode
description: Control the Lounge lights during TV mode
use_blueprint:
  path: Blackshome/sensor-light-add-on.yaml
  input:
    trigger_entities:
      - input_boolean.tv_mode
      - media_player.plex_plex_htpc_for_windows_lounge10
    trigger_on_state:
      - 'on'
    trigger_off_state:
      - 'off'
    time_delay: 5
    include_start_turn_off: disable_start_turn_off
    off_light_switch:
      entity_id:
        - light.lounge_lamp
        - light.lounge_lounge_washer_447
        - light.lounge_lounge_ceiling_509
        - light.lounge_bug_plug_led
    off_include_light_control: []
    off_light_transition_off: 60
    include_intermission: intermission_enable
    include_end_turn_on: enable_end_turn_on_snapshot
    end_snapshot_name: lounge_tv_mode_snapshot
    end_snapshot_helper: input_boolean.tv_mode_snapshot
    end_light_switch:
      entity_id:
        - light.lounge_lamp
        - light.lounge_lounge_washer_447
        - light.lounge_lounge_ceiling_509
        - light.lounge_bug_plug_led
    include_automation_link: enable_automation_link
    automation_link:
      - input_boolean.lounge_sensor_light_bypass
    light_switch:
      entity_id:
        - scene.lounge_all_off
        - scene.lounge_tv_setup
    include_light_control: []
    light_brightness: 0
    light_transition_off: 10
    end_include_light_control:
      - use_transition
      - use_brightness
    end_light_brightness: 50
    end_light_transition_on: 10
    intermission_state:
      - paused
    intermission_light_switch:
      entity_id: light.lounge_lamp
    intermission_include_light_control:
      - use_brightness
      - use_transition
    intermission_light_brightness: 20
    intermission_light_transition_on: 5
    intermission_light_transition_off: 5
    end_scenes:
      - scene.lounge_tv_off

@clowgg

I think this is the same as the sensor light… I will look into it… thanks for the heads up.

I will look at this at the same time… I don’t have plex and your set up… if I have some ideas would you be happy to beta test it?

Blacky :smiley:

Of course! Happy to help test as I’m in that mode at the moment anyway :grinning: :+1:

Okay, I will work on it much later (8 + hours away) and if needed I will PM you the the beta code.

Maybe you can add a functionality to play music when shower starts.

@Flagun

Thanks for your suggestion, I will put it on the list.

This can also be done in a simple automation that when shower is ON play music.

Blacky :smiley:

Hey Blacky,

QQ is there a way to enable automation when this blueprint is running?

Use case:

  1. I currently use sensor light blueprint with a motion sensor which gets disabled when Sensor light add on is running
  2. I have a second sensor light automation running off the same motion sensor but with min brightness so if someone triggers the motion sensor they still get some light but not enough to interrupt the movie watching and will turn off the light once motion is no longer detected.
  3. This automation is then disabled when the sensor light add on is turned off.

Another side question is there a way to use sensor light add on without using “Lights - Switches - Scenes *” I dont have anything i would like to turn on when starting this automation but this seems to be a requirement.

Thanks again for all your help!

Vijay

For some reason the by pass toggle doesnt get turned off at the end of the automation this might be more an issue with nvidia shield from what i can tell but hoping you have dealt with this issue before,