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.
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
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
Upgrade
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.
BLUEPRINT CODE UPDATE
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.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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?
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
I’ll try that now.
I meant ‘automation’
Done that - great idea!
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
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
![](https://community.home-assistant.io/user_avatar/community.home-assistant.io/clowgg/48/163647_2.png)
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?
I think this is the same as the sensor light… I will look into it… thanks for the heads up.
![](https://community.home-assistant.io/user_avatar/community.home-assistant.io/clowgg/48/163647_2.png)
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
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
Of course! Happy to help test as I’m in that mode at the moment anyway
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.
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