Never understood why with the emphasis on the visual editor and making the interface more friedly, users (novices) like me have to go into configuration.yaml to set so many things. Things like binary sensors, home radius, etc. etc.
I have tried to keep it so it works for everyone. Currently to use only binary sensor works well if and when we need to have a group for the trigger. So sometimes changing one sensor is better than changing the code because then you can upgrade with ease.
There are just so many options in HA.
Hope you understand.
Blacky
I wasnât commenting on your automation. I was commenting on how many things need to be manually put in that master config file as opposed to developers having a function to create a binary sensor, ask the right questions and do the work for you.
O ok thanks Harry
Thank you very much, it worked now I understand better of templates
Thank you for the reply. This is a common issue with Ikea lighting (confirmed in HA Discord) and people use the same solution in custom motion sensor light automations (setting up on/off status reporting in MQTT and periodically turn off lights when input boolean off)
Hi Daniell
No problem.
Input Boolean
If your not sure how to do this , below is an example.
First we need to create a âinput booleanâ. To do this follow these steps.
- First go to Settings / Devices & Services / click on the âHelpersâ tab / click â+ CREATE HELPERâ and select âToggleâ.
- In the name area, enter a name that best suits you. For this example we will put âIkea Light Helperâ. Then click save.
Now you will have and âinput booleanâ helper called âIkea Light Helperâ with an entity id of âinput_boolean.ikea_light_helperâ
Switch Template
To toggle this ON and OFF in the sensor light automation we will need to create a switch that controls the Ikea Light Helper( âinput booleanâ) that mimic it. To do this we can create a switch template. You will need to put the code below in your âconfiguration.yamlâ file.
switch:
- platform: template
switches:
ikea_light_switch_helper:
friendly_name: "Ikea Light Switch Helper"
icon_template: mdi:light-switch
turn_on:
service: homeassistant.turn_on
target:
entity_id: input_boolean.ikea_light_helper
turn_off:
service: homeassistant.turn_off
target:
entity_id: input_boolean.ikea_light_helper
In the above code:
- The "ikea_light_switch_helperâ change to your liking. (this is the entity id name it will create)
- The Icon change or remove if you like.
- The "friendly_name: âIkea Light Switch Helperâ change to your liking.
- You will need to replace the âinput_boolean.ikea_light_helperâ to the âinput booleanâ entity id you created above (you name may be different so you need to check this).
Once done you will then need to restart HA for the switch to take affect. Then add your new switch (âIkea Light Switch Helperâ) into âLights - Switches - Scenesâ and if using night lights into âNight Lightsâ
Now you can use your âinput booleanâ helper called âIkea Light Helperâ above to â(setting up on/off status reporting in MQTT and periodically turn off lights when input boolean off)â as it will turn ON and OFF (act as a light should) and be 100% accurate not like your Ikea lights.
Hope this help, and if you have any question please ask.
Blacky
I make both at the same time, so i dont know Thanks for this great work
Ok thanks for letting us know.
is it possible to incorporate an condition like an input boolean of binary sensor, with state selection.
the last room I have to incorporate this blueprint is my bedroom but I have a sensor that letâs me know if there is someone in bed and if thatâs the case then the light should not come on.
and would love a turn off trigger so when there is no motion anymore that it will turn of instead of a timer.
Maybe try using the bypass with your bed sensor, then in the bypass select â2 - Enable the By-pass - Turn lights OFFâ, then select âTrigger Sensor By-pass - Time Delayâ and set it to â0â.
When you do the bypass with your bed sensor make sure you have an OFF delay so if you get out of bed the light stays OFF for X amount of time. Maybe enough time to go to the bathroom and back + some.
I think the best way in the bedroom is to use a button next to your bed or if you put your phone on âdo not disturbâ (In a iPhone it is âFocusâ state âONâ) the bypass comes ON. Then you donât need a bed sensor. Just throwing it out there.
Hey. Thanks for your Blueprint!!
Looks pretty useful. Im fairly new to HomeAssistant. I have a ConBeeII Zigbee stick and have connected a Tradfri Motion sensor.
Now i want to use your blueprint to execute a configured scene. The scene itself works without any problems when i trigger them manually.
The configured blueprint looks like this:
alias: FaucetLight
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.kitchenmotion_motion
end_scenes:
- scene.faucetoff
time_delay: 0.5
include_light_control:
- use_brightness
include_sun: sun_disabled
include_ambient: ambient_disabled
ambient_light_sensor: sensor.lumi_lumi_sensor_motion_aq2_illuminance
light_switch:
entity_id: scene.faucet100
light_transition_on: 2
light_transition_off: 2
include_bypass: bypass_enabled_turn_on
ambient_light_options: ambient_light_option_disabled
include_night_lights: night_lights_disabled
But this does not work. I thinks this a just a really basic example without any special configurations.
Any idea whats going wrong?
Hi David, firstly welcome to the community
Thanks for your question and providing your YAML of the automation It makes it easy for me to see what is going on.
It looks like the problem is within the by-pass. You have selected to enable the by-pass but you havenât entered in a switch for the by-pass. So you have 3 options you can do.
- Enter a switch for the by-pass.
- If you donât have a switch you can create one and enter it in. See the FAQ on how to do this.
- Disable the by-pass.
Hopefully this will resolve your automation
On another note. Looks like you would like to use transition as you selected 2 seconds. In your light control you have selected to use brightness. When using scenes, brightness is normally done within the scene as you can select different brightness for every light. I would suggests you control the brightness in the scene and untick to use brightness. If you would like to use transition then you would select to use transition.
Hope this helps, and let us know how you go.
Blacky
Iâm getting the following error when transition is disabled:
Transition value 0 is not valid.
Is it a known issue? Why does it try to use the transition when itâs disabled? It started to occur after I updated from 2.8 to 4.2 blueprint version.
If I enable the transition option and set the delay to 0.1, it works fine again.
Hi, thanks for letting us know
Yes I am aware of it, you are probably using zigbee2mqtt. This is one think I have on my list to fix and will probably be done in the next release.
For now enable the transition option and set the delay to 0.1 and stay tuned for the bug fix.
Thanks again.
Blacky
Hey Blacky. Thank you for your support. You were absolutely right.
Now it works!
Thanks!
Hello
Would it be possible that âTrigger Sensorâ is extended that also a light can be used as trigger.
Background:
The light on my toilet can be activated via:
- Contact sensor
- Motion Sensor
- HomeKit
- Shelly Web Page
- Button click
Contact and Motion is not a problem, but if someone turns on the light directly via e.g. Shelly Page, it will not go off automatically anymore.
I was able to build an automation for myself where that works, but this one is significantly better.
That is my blueprint
PS: Also, an option for the alarm panel would be cool
Hi
Firstly some house keeping. In this post we would like to stay on topic and not have everyone post their blueprints. I hope you can understand. I know this was not your intent but would you be so kind to remove you blueprint code . If you would like help on it you can create your own post, or you can always private message me. I do help a lot of people privately. Thank you.
To your questions.
In your toilet, could you confirm what sensors are you using to turn a light ON and do you have a toilet exhaust fan? Sensors may be;
- Motion.
- Contact.
- etc
HomeKit, shelly web page and button click I am assuming this is just turning the light ON manually.
From knowing that I will be able to assist further.
I have also released and new blueprint that can work as an add on to this blueprint. Using this will allow you to have an alarm option. It can take a snapshot of your lights when a alarm has be activated, disable automations, turn lights ON or OFF and return it back to itâs original state once the alarm is cleared. It can also do so many other things. It all depends on what you are trying to achieve. If it is to just disable this automation when a alarm is in a particular state then this can be done through the by-pass. If you can let us know what you would like to achieve I can also help you here.
Blacky
I been using your blueprint for awhile and it works great, but I have recently been getting these errors
Logger: homeassistant.components.homeassistant.triggers.numeric_state
Source: components/homeassistant/triggers/numeric_state.py:185
Integration: Home Assistant Core Integration (documentation, issues)
First occurred: 11:24:02 (16 occurrences)
Last logged: 11:24:02
Error in 'Kitchen Motion Light' trigger: In 'numeric_state' condition: no entity specified
Error in 'Hall Motion' trigger: In 'numeric_state' condition: no entity specified
Error in 'Landing Motion' trigger: In 'numeric_state' condition: no entity specified
Error in 'Back Garden Sensor Light' trigger: In 'numeric_state' condition: no entity specified
any ideas whats wrong?
here is one of my automations
alias: Kitchen Motion Light
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.kitchen_motion_sensor_occupancy
include_light_control: dont_use_brightness
include_sun: sun_enabled
time_delay: 1.5
end_scenes:
- scene.kitchen_motion_light_off
include_night_lights: night_lights_disabled
light_switch:
entity_id: scene.kitchen_motion_light_on
sun_elevation: 0
include_bypass: bypass_enabled_stop
motion_bypass: light.kitchen_lights
light_transition_on: 0.5