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

The latest update appears to have fixed my issues. Thanks!

1 Like

Thanks for letting us know.

New Update - Version 1.4

New Features :new:

Added two new by-pass options.

  • Enable the By-pass - Turn automation ON
  • Enable the By-pass - Turn automation OFF

Bugs Fixes :bug:

  • Fixed bug if a switch was turn ON at the start of the automation.
  • Fixed an error when transition was disabled like shown below. This was probably when you are using zigbee2mqtt.
Transition value 0 is not valid.

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,

Thanks for the great blueprint! One smaller issue I’ve noticed in my setup: I’m using the sun condition, which initially works as expected, however when the sun sets while watching a movie, the lights aren’t turned on, only after changing the TV state the next time. Would be great if the lights get turned on when reaching the set sun elevation while the TV is on as well

Thanks,
Jones

@JN_Jones

Hi Jones

Thanks for the feedback. Yes I agree, and I better do the same for ambient. I will do an update for this :+1:

Blacky :smiley:

1 Like

New Update - Version 1.5

New Features :new:

Added two new features to sun and ambient options.

  • If the trigger is in an ON state, and the automation is blocked from running due to a sun or ambient condition, it will now turn ON when sun or ambient falls below its setting.
  • If the automation is running, when sun or ambient rises above its setting, it will now turn the automation OFF.

Bugs Fixes :bug:

  • Fixed bug in “Enable the By-pass - Turn automation OFF” for snapshots.
  • Fixed bug in “Enable the By-pass - Turn automation OFF” for intermission lights.

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

Is there a way to extend the turn off time past 30 min. ? I’ve got a bathroom situation where 30 min. Isn’t enough.

@potts-mike

You can just simply type the number (time) you would like into the text box and click save :wink:

Another small point/suggestion: I’m using this alongside adaptive lighting. Overall this works fine, when the blueprint turns the lights on or adjusts them, adaptive lighting marks them as manually controlled. However on pause or at the end I’d like to go back to the lights being controlled by AL. The easiest way to do this would be to call a service provided by AL. While there are some workarounds to achieve this, I’d like to see this possibility directly in the blueprint. Basically besides activating lights or scenes calling any arbitrary service.

@JN_Jones

Will the " Intermission Option" work?

If you go back to the sensor light blueprint it should reactivate you AL.

Let me know if it is not doing this and I will have to install AL.

Blacky :smiley:

Hi, the when (intermission/end) work as expected. The only topic is what to do - I’m currently not using the sensor light bp in that room so can’t test that now but from my understanding of AL so far there are three ways to get a light back from manual control:

  1. Turning it off and back on (which might be a solution with the sensor bp but would cause at least a short flickering)
  2. Define a timeout for manual control. As the time until pause/end differ and are not known beforehand this isn’t a solution here.
  3. Calling the corresponding service

There might be other ways but I’m not yet that familiar with ALs internals. I was also thinking about using the snapshot functionality but I’m not entirely sure how AL would react on that and whether it’d reset manual control. I’ll try to dig deeper into other possibilities but unfortunately am a bit busy the next few days.

@JN_Jones

No problem thanks for keeping us posted and once you know more just let us know and I will take a look at it.

Hi @Blacky,

I’ve tried to check this a bit further and got closer to the solution I’d like but I’m not able to get it exactly to what I’d like.

In my current test scenario I have

  • Two lights that are controlled by a motion sensor, managed by the Sensor Light blueprint
  • A template binary sensor as trigger for this blueprint
  • Automation link is enabled
  • AL is enabled for both lights, handling with the main blueprint works as it should
  • A (home assistant) scene where both lights are set to a predefined brightness

This results in the following behaviour

  • Normal movement turns the lights on, brightness is set by AL
  • Turning the sensor on activates the scene, sets the brightness as expected and marks the lights as manually controlled in AL
  • Turning the sensor off turns the lights off until a new movement has been detected, after which the brightness is controlled again by AL

However this results in the lights to be off after this blueprint ends. Ideally I’d like to keep the lights on for at least a short time. I’ve tried to combine the automation link with the end turn off setting but this resulted in some weird off/on transition.

One idea I still have would be to misuse the automation link control:

  • Configure it in the Add On using one input but use a different input in the main blueprint
  • Add an automation that listens to the input of the automation link
  • If turned on, also turn on the second input => Turn off sensor light as would the automation link
  • If turned off, call the manual control service of AL, wait some time and then disable the second input => “Delay” the automation link

I’ll try to check whether that works over the weekend

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.