@Blacky Thanks for helping. I tried it today with delay_on and 10 seconds.
Basically, I walked into my ensuite bathroom then lights turn on then I jump into the shower and close the door then Lights stays on then I open shower door and lights momentarely goes off and comes back on again. Weird!
How does the delay_on fix the issue?
I looked at your Bathroom Humidity Exhaust blueprint. It looks good but not sure how I can use it. I still have a dumb exhaust fan that I need to turn on by the wall. I think I will have to get into the roof and connect a smart plug to be able to control it with HA. I do have an Aqara Temp / Humidity sensor I can stick to the ceiling above shower head.
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.
Can you also provide us the entities that are in each scene you are using.
This will make it that both must be ON for it to be ON and both must be OFF for it to be OFF. I think that is what you are after
template:
- trigger:
- platform: state
entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
to: "on"
id: "t1"
- platform: state
entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
to: "off"
id: "t2"
- platform: state
entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
to: "on"
id: "t3"
- platform: state
entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
to: "off"
id: "t4"
binary_sensor:
- name: "Kitchen Stove and main Occupancy Sensors"
device_class: occupancy
icon: mdi:motion-sensor
state: >
{% if (trigger.id == 't1' or trigger.id == 't3') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'on') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'on') %}
on
{% elif (trigger.id == 't2' or trigger.id == 't4') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'off') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'off') %}
off
{% elif trigger.id == 't4' and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'on') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'off') %}
on
{% elif trigger.id == 't2' and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'off') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'on') %}
on
{% endif %}
I have updated the template sensor to a more modern one for you.
What will happen is when the door is open it will be clear and when the door is closed it will be detected. When the door opens it will take 10 seconds for it to show clear allowing you time to trigger your motion sensor. You need to group this sensor with your motion sensor.
The only thing is, if you are using the delay in this blueprint for your light/s to turn OFF then you will not need the delay in this template sensor. Maybe your not using this blueprint . Maybe try using this blueprint or maybe you havenât groped them . Groping them is critical for it to function correctly. So if you didnât have them grouped before then first try it without the delay but grouped.
Below is without delay. You need to group this sensor with your motion sensor.
@Blacky Thank you. I just made the changes and itâs working.
Now I and the wife just need to remember to leave the shower door open to let the lights turn off automatically.
I wonder if thereâs a way to get the shower door sensor to work in such a way that when the door is closed, opened and closed once you are in the shower that it will then keep the lights on. When you are finished in the shower, open the door and close the door, the motion sensor will trigger and work as normal and lights turn off as normal after time delay.
Looks like you would like a safe guard that if the door was closed after a shower the light will turn OFF in X amount of time.
You can do this but you will need a trigger-based template binary sensors. The below code will work the same as before but has a 15 minute auto OFF . Just change the minutes to a time longer than you would have a shower for. This way if you accidentally close the door and go to work the light will turn OFF in 15 min + your delay time set in the blueprint It will probably work well anyway as by the time you get out of the shower, dry and XYZ you would probably consume most of this time anyway.
template:
- trigger:
- platform: state
entity_id: binary_sensor.shower_door
to: "on"
- platform: state
entity_id: binary_sensor.shower_door
to: "off"
binary_sensor:
- name: 'Ensuite Shower Door'
device_class: motion
icon: mdi:door
state: >
{{ is_state('binary_sensor.shower_door', 'off')}}
auto_off:
minutes: 15
Is there a way to have the off condition to not actually turn the lights off but to set them to a lower brightness?
I have several hallways in the house that are always dark so I leave the lights on 20% and then increase to 80% on motion - after 5 minutes i put them back down to 20%. Overnight (11pm-6am) I shut them off completely.
My Scene that needs to be turned On: âHA-Scene-Tuin-V-Aanâ
My Scene that turns the lights Off âHA-Scene-Tuin-V-Uitâ has the same setup and devices, but set to Off in the scene.
For the Nightlights I included 1 Hue Entity (light.hue_1e_werkkamer)
This Sceneâs are a combination of 6 Hue outdoor spots added as Device (all like: âlight.hue_tuin_v_spot_2â in the scene and 2 Entities, both Fibaro z-wave modules (like: " light.fib_dim_koof_voor_3".
For some weird reason the blueprint randomly stopped turning off lights, after turning them on.I have a motion sensor and light hooked up with sun elevation, but it never turns the light off.
Currently the way you could achieve this is to have 2 automations and use the global time (Use The Time Options (Optional)).
One automation will run from 11 to 6 and the other one will run from 6 to 11. Both automations will have your light entities entered into âLights - Switches - Scenes - Scriptsâ but the one that runs between 6 to 11 you would create a scene with your lights at 20% and put that scene in the âScenes - Scripts To Turn OFFâ.
I can see a problem in your YAML and I will explain scenes so anyone reading this may also benefit from it.
Use Of Scenes
When we add a scene into âLights - Switches - Scenes - Scriptsâ and or âNight Lightsâ and donât have any entities added then the automation canât determine if the light is ON or OFF for that input. Scenes donât have an ON or OFF state, HA just calls the scene to your settings. To combat this behaviour adding just one entity from the scene into the input allows the automation to function correctly as it can see entities and then knows what is happening. This applies to each input (âLights - Switches - Scenes - Scriptsâ and or âNight Lightsâ).
Example;
If we add a scene into âLights - Switches - Scenes - Scriptsâ and have no entities entered then we can add one entity from the scene into this input. Now the automation knows what is happening in this input. If you have entered in an entity into this input regardless if it is in the scene or not then that is okay as well.
If we add a scene into âNight Lightsâ and have no entities entered then we can add one entity from the scene into this input. Now the automation knows what is happening in this input. If you have entered in an entity into this input regardless if it is in the scene or not then that is okay as well.
Back to your automation
Before I go down a rabbit hole testing can you do something for me and test it please.
In your âLights - Switches - Scenes - Scriptsâ input can you add one entity from your scene into this input.
In âNight Lightsâ I can see you have already inputed an entity into this input âlight.hue_1e_werkkamerâ. If you would like to turn that light ON and OFF then that is all good, that input is all set up correctly. I am not sue if that light is in the scene or not but ether way it will work. If the light is not in the scene and you donât realy want to turn that light ON and OFF you can remove it and add a light or switch entity that is used in the scene.
This sounds like a lack of communication between your motion sensor and HA. If you would like me to check your settings then can 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.
Thanks for your prompt reply and support.
I will add one of my Hue lights that is part of the scene as a separate entity on top of the scene. I will let you know if it worksâŚ
Donât forget it is also Christmas Holliday for you , so no problem if you will not respond coming dayâs
Find it strange that it worked perfectly fine for the past 2 months without modifying it, then randomly stopped functioning properly. It could be my motion sensor giving way (battery seems fine), which I hope it isnât the case. ;(