I was just playing with brand new automations, and I realised there is one thing people don't mention in tutrorials on Trigger ID's. That is the Automation Mode. For an example, if you have an automation with delays in it, that part of the automation is still running, which means none of the other triggers will work if your automation is in a "Single" mode until that delay is over. As an example, if you have an action with a delay of 5 minutes, the automation is still running during that 5 minute action delay, which means in Single mode, your automation will not trigger at all in that action delay period. This means you really have to think very carefully on how the different triggers and actions correlate with each other and what mode your automation runs in.
This was a lot tidier than creating automations with a bunch of IF/ELSE conditions , especially when using several conditions to turn on during different time ranges of the day. Finally clicked how to use the "choose between two actions" in the correct way.
Thanks! Being relatively new to HA, your tutorials are very helpful. My Automations have been simplified to use Trigger ID, thanks to you and this video.
Na al meer dan een jaar HA te hebben, was dit iets wat ik zocht. 6 automatisaties herleid naar 1 of 2 eens je door hebt wat je wilt bereiken. Je video's zijn heel leerrijk en toch gemakkelijk uitgelegd. Het slechte nieuws is dat ik weer extra werk heb om alles te herschrijven maar dat is het waard! Geweldige thanks bovenbuur!!! Toppie!!! 😁😁😁
In the same day, in about 15 minutes you taught me about Helpers & Trigger ID's to optimize my automations. Thank you so much, I didn't get a chance to really look in on the documentation and play around, and your videos are very well explained, very thorough and very much appreciated. You have a great presentation style. Cheers.
J'ai particulièrement aimé l'exemple des lumières extérieurs à 9:30 du vidéo. J'ai hate de voir si ca va fonctionner ce soir et demain matin :-) Merci pour le vidéo! Maj 9 Jan 2023 am = oui tout à fonctionné! Je vais appliquer cela à d’autre automatisation qui sont en en double ! Encore merci !
Glad to see you back on the HA scene to provide such useful videos. You've just made my day, I updated all my motion/contact detection based automations.
Thanks for a great video! That is the video I am looking for, I used to use 3 automations for notifying 15', 30' and 45' each hour. Now I can re-organize it into one automation. That's cool!
Thank you! On week 2 with HA. I have HA Yellow Standard. Your tutorial has helped me set up successfully! I was going mad, but think certain motion sensors were not working for some reason. But have this set up in another room perfectly. Thanks so much.
Thank you so much for this tutorial as well as the how to use motion sensors properly. I must have tried 10 or 15 times to figure this out, and watched and read just about the same amount video/HA documentation, and blog posts. You are an excellent instructor.
Junkie, you are the best with your step-by-step explanations. I was going crazy trying to figure out how to do a single automation with 2 triggers and 2 actions. Thank you :)
@@SmartHomeJunkie So there is one thing I do not understand- in your example the light turns on when motion is detected and off when no motion is detected- I assume the amount of time it takes to turn off is based on the motion sensor default- How would you tell the light to stay on for X minutes before turning off? Would you use "duration (optional)" choice on the light-off trigger or would use a condition or would you use the transition option in Actions? Thanks.
Yet another great video. I was struggling to get a boolean to trigger because I couldn't find a way to select it and change the state but going the other way where I did a call service ==> input boolean: turn off ==> with my boolean being the target made it work.
I haven’t use automations for a while since i started using nodered but now i’m tempted to use it again with trigger ids. This is gonna make everything a lot tidier
Thanks for this. Working through my first sets of automations and was wondering how to combine on/off start/stop events into one automation. Good work.
This was very helpful, trigger_id's finally clicked after watching this. Been re-doing a bunch of my automations and successfully combing them into one. Thank you!
Just what I needed, thank you! - I was trying to modify an existing automation that already had a single action defined, so completely missed the _choose_ action and couldn't figure out how to get the separate sets of actions into the automation. All working now though, thanks to the video.
I never got my head around triggers, but I understand now. I spent the last couple of weeks building HA back up from scratch as my instance kept crashing with no explanation. I didn't like any of the blueprints for the Aqara Cube, so I started last night extracting attribute for what face side it was on, however that would have meant multiple automations. Thanks to you I can do one automation for all the features on one side. Your timing could not have been better. Thank you.
@@antoniodecrisci2369 I am using Zigbee2mqtt with Sonoff dongle, like you say the blue prints can glitchy. Using the face attribute the automation defines what face is up. There are many different actions per face, each action would require a separate automaton, Using trigger IDs can put all the triggers and actions in one Automaton, One face will represent one automaton for all the actions available on that face. So instead of having 54 sperate automations, you just have 6. I hope this helps
@@davidlangley833 thanks for sharing. I must be missing something because at the moment I have one automation entry created and it does about 10 different things, for example it dims and brightens my main lights, open and closes my shades, turns on my fan heater and off, streams music. And with one shake it stops or turns off all these entities. That's maybe 10 things in one automation, using the standard 57 move blueprint. Does this sound correct to you?
@@antoniodecrisci2369 That does sound correct, if necessary I could use all six faces in one automaton, but for me that becomes complicated to follow. Included in 57 actions are turning from one face to another, for example face 5 to 1 or face 3 to 1 etc. which increases the number of auctions. The' basic' automations on one side is 7 actions x that by 6 facesthat is 42 actions. Using the examples above that increases the number of possible actions. My personal coding skills are not great, but using my automations instead of blueprints gives me more control to fulfill my use case. Blueprints are excellent, don't get me wrong and anyone coding the blueprints are incredibly talented. I think I like to know how yaml works hence I will try and do my own automations. Again I hope this helps.
@@SmartHomeJunkie So far, so good. Just combined 3 Automations into 1 using Trigger ID's. Odd question: when adding additional conditions, is it necessary to use "AND"? Do you know if, when there are more than 1 Conditions (i.e. Trigger ID and Sun), the default is AND or OR? Below is a yaml example: OPTION 1 (using AND) - choose: - conditions: - condition: trigger id: back_door_sunset - condition: and conditions: - condition: sun after: sunset OPTION 1 (not using AND) - choose: - conditions: - condition: trigger id: back_door_sunset - condition: sun
just spent several days chasing my tail not able to get a complex automation to turn off on no-motion trigger. As per usual, check to see if Uncle Ed has a tutorial and problem solved in minutes!!! :) I never thought for a minute that my no-motion trigger should go at the top of the tree and then be referenced as a later option - initially that's counter-intuitive to me - I've been adding it as an action (wait for trigger)at the end of all my if/then/else conditions - and failing every time. With this method though, when I ran it from the UI, it showed it had taken a third option and done nothing, that's all that showed up in Traces, so I thought I'd done something wrong. BUT, walk into the room, correct scene comes on, leave room and get back to laptop to check and it's switched them all off! :) Thanks yet again mate!! :)
@@SmartHomeJunkie I wrote YAML for 15 binary sensors to create time slots based on sunrise/set, because sun isn't available as a helper, only time. But watching this, I think I could have just had multiple trigger IDs based on sun instead and done it all in the UI - I'll give it a try, as it'd be easier to share as a self contained blueprint instead of code. Every day's a school day!!
Many thanks for this. I've built three smart power strips each with four sockets which are individually switched using ESP modules and ESPhome. All 8 sockets on two of the strips come on at 2:00 am when we have cheaper electricity. The 4 sockets on the third strip also come on at 2:00 am but only if an input boolean is set (used mostly to charge power tool batteries, so infrequently). All 12 sockets turn off at 6:00 am when electricity costs more. But two sockets (one on each of two strips) are dedicated to charging phones (one for my phone, and one for my wife's phone). So each of these two sockets will turn off if the individual phone status shows not plugged for two minutes. Also, each one will turn off if the respective 'phone battery level reaches 95%. Two further sockets are dedicated to charging laptops and will turn off after 2 hours (the time it takes to charge each one from almost flat). Finally, one socket is dedicated to fast charging 18650 batteries and will turn off after one hour. To achieve all that, I had 11 automations but after watching your excellent RUclips video, I have everything controlled with a single automation. So many thanks and keep up the good work and I'll certainly buy you a coffee. I have my own RUclips channel so I know just how much time and effort goes into making these videos. Ian
Nice example of the use of multiple triggers. You mentioned in the text that we could ask for a specific automation. Well i have one: I use a Xiaomi curtain motor in the bathroom window. I would like to open the curtain at different triggers depending on the season. Eg in summer it should open at time 07:45, but in the winter it should only open at eg 09:00. At the moment the opening happens at a specific time. And closing works on sunset with an offset. But the combination of season and time, with for each season a different time is what i am not getting right. Would be great if you could help me with that.
Thanks a lot for this another useful video. I had decided to use Node Red since I can put one group of automations together in one flow. The idea was that I would have a better overview. But experienced that it's dificult there to deal with boolean logics and you have sometimes have to convert values etc. As far as I can see it's possible to create a group of automation tasks in one automation using trigger-id's which is excellent. So I have now decided to bring over my Node Red automations to home assistant automations.
This is a great tutorial. Would it be possible to do a slightly updated version to show the current Home Assistant setup? Although still similar, there are some differences now. When you click the 3 dots on the trigger now, the option is called Edit ID rather than Edit Trigger ID and then you get the Trigger ID field.
Thanks for the nice and clear tutorials. It helped me a lot to develop my boards and automation. It’s an addiction this HA. Keep continue the nice video’s.
Good tutorial. Although, I can do this in HA without trigger IDs but with device and it still works. I am not sure if HA recently made an update to automations to make them better. I am currently using one automation to turn on/off my garage lights without trigger id. Is there any benefit to trigger IDs now? My next step would be to group my garage doors together to turn on/off the lights. I am not sure if trigger id will allow for easier grouping. Ps: it funny that I used one of you videos to setup my motion sensor lights and you used trigger ids but I was too lazy to watch your video on trigger id and used device instead and it still worked. That how I found out. Now, I came to your trigger id video to understand how it works and it looks easy. Lol
Great video! I think I've watched it 4 times over the past few months! Question, maybe a bit off topic, why do you use "call service" instead of "device" then "turn device on/off" entity?
I'm new to HA, so maybe something has been added since this video. An even more powerful feature is to use 'automation trigger variables' to handle multiple states or even multiple entities. For example, the on/off state of the motion detector is available as trigger.to_state.state. The entity_id is available as trigger.entity_id. You could pass the motion state directly to the switch service with no conditional logic. If you're clever in naming your entities according to a pattern, the same automation could handle ALL your motion-controlled lights. There are way more trigger variables than alluded to in the documentation. Once your automation has been triggered at least once, click on TRACES at the upper right. Then click on the 'Changed Variables' tab. You can use any of those variables in your automation. I do use Trigger IDs to introduce associated data. For example, you could set the trigger id to the entity_id of the light you want to control. Again, this eliminates redundant logic. The automation is driven mostly by data rather than code. I don't know if people are exaggerating, but you shouldn't need 100s of automations. At some point you must be repeating similar logic?
Gives me a better idea on what the Trigger ID's did, I was hoping it would help setting up a trigger with another trigger, eg, if Entering Zone and then open the front door for 2 seconds then do this action, but unfortunately not... but hey... at least I learn't what triggers do... which is a win... keep up the good content.
You might want to watch this video. It's a lightly different subject, but it explains exactly how you can daisy chain automations so that they trigger each other: ruclips.net/video/sNmonuw4EHo/видео.html. And you can use the AND action within the action part of an automation, so if you create two trigger IDs and combine them using an AND or OR in the actions part of an automation, you will get your result as well I believe.
What is the reason for choosing "Calling a Service" as the action instead of just using a Device action? Also, can TriggerIDs be shared between Automations? I tried it and it doesn't look like it. That would be helpful to make the triggers more reusable so they don't have to be redefined in several automations. I believe in defining something only once.
I explained in a couple of videos why calling a service is better. Mostly because you can easily swap out devices if you call a service using the entity id. This cannot be done using a device call.
OR you create a automation triggered by detecting motion which turns on lights then starts a delay and after that turns the light off. You give this automation de mode restart and it works the same. To be honest, I do not know which way would be more or less demanding on the HA system. I just find my way easier to read and debug. Nice explanation of Trigger ID's tho!
Great tutorial, thanks! I understand that combining automations reduces the number of automations. Are there any other benefits to combining automations using triggers?
It gives you a much cleaner overview of all your automations if you have one automations that performs several tasks for the same device. I had loads of them and sometimes it was very difficult to find the one that I made for a specific device. Now I have much less automations which makes my workflow a lot quicker.
Hi there, appreciate your videos that are super helpful for beginner me. Question: Do you have a video or can point me to how you added the bulb/light controls? ie. The transition time, RGB value, etc.? I have a basic setup with a Smart Life RGB bulb HA but I cannot see all these options and it limits what I can do.
Great tutorial, I am new to home assistant and have followed your tutorials when learning anything to do with home assistant so thank you, but I'm having an issue where once the light has turned on it will turn itself almost immediately, I've checked but cannot see why, do you have any idea why.
can you create automation that uses time event to start Power switch to turn on my Xmas lights at 4pm and off at 10pm but only Monday to Thursday and Friday Saturday & Sunday start at 4pm still but turn off later say 11:30pm please , I am at a loss was trying to use time patterns also but no luck !
BTW excellent videos. I'm learning a ton with you! Question: in the case I have motion sensors that I want to turn active when the sun sets but offset by time how do I do that and where? This video shows something similar and could see the offset feature but this is not I need. My offset is for the sensor and not the light. Hope this makes sense
Great video, thank you for putting this together. I am curious, any particular reason why I should pick Call Service instead of the Device? I usually pick Device>Kitchen Light 1>Turn On...
With call service you have more options and you do not depend on a device ID. If you have to exchange a light later on, the automation still works if you use call service. It won't if you use the device because of the needed device ID.
Nice video but with time conditions it can also go wrong If the trigger is a sensor and condition that lights can go on and off only between 8 and 9 for example. Most of the sensors has already a time delay for 1:30 min What if time is 8:59 and sensor is triggerd light will go on. but will never go off again because of the time delay of the sensor and after 9 the automation will not run
Good morning - always follow your tutorials. I set up the motion activated light just as yours. In rare cases, when the light is turned off triggered by the light_off, the light will not be triggered by the light_on until wait for some time. I was wondering if it's because both light_on and light_off are almost triggered at the same moment? And the light was triggered by light_off and missed light_on, so the next light_on trigger has to be waited for. thanks!
Are trigger ID's unique to an automation? I want to have 2 automations to control 2 different Hue dimmer switches (4 buttons). Could they both have Trigger ID's of "button 1 short press" (as an example) or do they need to be globally unique?
Hi and many thanks for this nice and powerfull tutorial👍 Creating "global" trigger id's, we can use in multiple automations, is not intended or planned....? This could also make the work easier when specific triggers will be used more often.
So the Trigger ID lives within an automation so to say? Like you created a Trigger ID within the automation, and this Trigger ID cannot be used/called upon in another automation?
Many thanks for your video (and the one about sending email notifications using GMAIL). Oddly I can get the Aqara water sensor to email but can't get the thermometer to send an email if the temperature gets above a certain point. My question relating to triggers is do I set a trigger/automation based off devices or entities as the sensors appear under both.
Thank you for a great helpful video, I have managed to do a Automation to setup a Shelly Button 1 but on doing so I m having to wait 3 mins between each press of the button for light to turn on or off? Im also trying to find a way to send to mobile and my location with google map and for it to ring or text the location is there ways to do this. Thanks
What a great tutorial again! I follow your tuts with great interest. Thank you for making these tutorials. I have a question however, slightly related with this topic. I have an automation, where i use two different times and a template where these times are being used. I would like to use variables for the times, so when i change the times in the automation, the times in the template will also be changed. Now i have to change the times on two places... Do you perhaps have a solution for this?
@@SmartHomeJunkie OK, never used helpers... But i am watching your tutorial about helpers: ruclips.net/video/2tRZ_WA8Xyc/видео.html Trying to use that for my issue. Thanks for your great tutorials!
Good tutorial. I like the idea of trigger IDs and I use them, but it isn't clear to me to what extent it is smart to use them. The more complicated an automation, the harder it is to get you head around how it works. Especially if you haven't touched it in a while. more atomic automations may be easier to debug.
What I normally do is draw a schema of the automation I'd like to create on paper first. After that I am building it up step by step and test every step. I have done pretty complex automations that work very well, but sometimes it took a while before I got it to work perfectly indeed. And yes, you don't have to use Trigger IDs for everything. In some cases multiple automations will make it easier to develop the goal that you want to achieve.
Hi, In your video you are placing a general condition to work only been 9 AM and 9PM. In such case if there is continuous motion at 9PM wont the light always stay on? Is there an elegant way to avoid this?
Thank you for your comment! In such cases, it's important to consider using a motion sensor with adjustable sensitivity or a timer function to avoid the light staying on all the time. Anyway, as long as there is motion in a room, you do want the lights to stay on, don't you?
@@viggyprabhu Ah, I understand what you mean! Good find! Yes, in this case, you can move the condition to the Then Do section and add it only as a condition to the turn-on Trigger ID part.
nice video and walkthrough and nice automation, but i have a problem with it, i use it with condition sun, if it gets triggered just before the condition expires, and the off trigger is after condition, the light is on all day. how do you avoid it
Really great tutorial - I have 10 blinds in my house that open at sunrise, close at sunset - each with a 3 min offset from the other - can I define all 10 in a single automation using trigger Id's ?
@@SmartHomeJunkie So I have not nested those automations yet, working to ensure that I get the format down correctly. In all of these where I'm using the Trigger.id I'm getting an error of: "Stopped because of error" "required key not provided @ data" - I'm not sure what this mean. Along with this I have two, yep, two Entity options available (two separate lines with an Entity drop down with the word Entity in different fonts) Is this correct ?
@@archiemarper I don't know why you get the error. About the two entity fields, you are correct. Since two versions ago it's possible to add multiple entities to a trigger in the ui. It was already possible in yaml, but you see this in the ui now too.
@@SmartHomeJunkie No problem. That make sense!!! For now I've disabled these automations as they don't run to completion and I'll play around with them over the weekend. Thanks
Final reply and again I do appreciate your hard work in this and other video's you have created. A great user from Reddit @PierogiMachine discovered that I did not have any data in the second sequence. In other words, since these are blinds, sequence 1 has a Cover: Set Position open value of 50, however, sequence 2 has a Cover: Set Position closed value of 0 (zero) (which leaves the automation to interpret that as a null value when looked at in YAML). When I changed that second sequence to 1 for Close the automation ran successfully.
Do you have videos for infercaing with Ecobee thermostats? I need an automation that controls batching my Ecobees at ince. I can't seem to control the fan function alone. I would use this to create a Fresh AIr Function.
Good Day - just followed your video and set up an automation to trigger a light on/off based on motion - worked perfectly - except for - in the action section, all my home rooms show, except for the Guest Bedroom - which is where I setup this automation (I had to select the actual light switch "device"). I verified the light switch is in the area/zones for the house, the light switch and motion detector are assigned to the guest bed room, I have restarted and reboot HA, but the Guest Bedroom does not show in the Call Service choice of this automation. Your help is appreciated.
Well - just learned, that lights and switches are different. My guest bedroom "light switch" is actually a "switch" entity. When in Call Service, if I select "switch", the guest bedroom shows up. All is good. At the very least - thanks for listening...it helped me learn the difference between switches and lights...as entities. in
Amazing! You’ve just halved my code! Cannot believe I didn’t know about triggers. I’ve got so many automations for on and off!! Thank you 🙏🏻
Great that this helped!!!
Same here, I was shocked to see that this clip was 9 months old 😅
This might be the single most useful tutorial on Home Assistant I've ever watched. Trigger IDs with Choose Action == better automations.
Thank you for this compliment!
I was just playing with brand new automations, and I realised there is one thing people don't mention in tutrorials on Trigger ID's.
That is the Automation Mode. For an example, if you have an automation with delays in it, that part of the automation is still running, which means none of the other triggers will work if your automation is in a "Single" mode until that delay is over. As an example, if you have an action with a delay of 5 minutes, the automation is still running during that 5 minute action delay, which means in Single mode, your automation will not trigger at all in that action delay period. This means you really have to think very carefully on how the different triggers and actions correlate with each other and what mode your automation runs in.
You are creating some really good suggestions that seem to be missed by other presenters - well done and really useful - just subscribed
Thank you for the compliment!
This was a lot tidier than creating automations with a bunch of IF/ELSE conditions , especially when using several conditions to turn on during different time ranges of the day. Finally clicked how to use the "choose between two actions" in the correct way.
I can't thank you enough for your second sunrise/sunset automation! That works perfectly!
Thanks! Being relatively new to HA, your tutorials are very helpful. My Automations have been simplified to use Trigger ID, thanks to you and this video.
Nice tutorial Ed! This will surely simplify a lot of my automations. Greetings by a fellow Dutchie.
Na al meer dan een jaar HA te hebben, was dit iets wat ik zocht. 6 automatisaties herleid naar 1 of 2 eens je door hebt wat je wilt bereiken. Je video's zijn heel leerrijk en toch gemakkelijk uitgelegd. Het slechte nieuws is dat ik weer extra werk heb om alles te herschrijven maar dat is het waard! Geweldige thanks bovenbuur!!! Toppie!!! 😁😁😁
Heel graag gedaan! Fijn dat ik je kon helpen!
In the same day, in about 15 minutes you taught me about Helpers & Trigger ID's to optimize my automations. Thank you so much, I didn't get a chance to really look in on the documentation and play around, and your videos are very well explained, very thorough and very much appreciated. You have a great presentation style. Cheers.
Thank you for this for Stephen! 🙏🏻
J'ai particulièrement aimé l'exemple des lumières extérieurs à 9:30 du vidéo. J'ai hate de voir si ca va fonctionner ce soir et demain matin :-) Merci pour le vidéo! Maj 9 Jan 2023 am = oui tout à fonctionné! Je vais appliquer cela à d’autre automatisation qui sont en en double ! Encore merci !
Glad to see you back on the HA scene to provide such useful videos.
You've just made my day, I updated all my motion/contact detection based automations.
That's awesome to hear! Trigger IDs are so useful in cutting down your automations, aren't they?
Thanks for a great video! That is the video I am looking for, I used to use 3 automations for notifying 15', 30' and 45' each hour. Now I can re-organize it into one automation. That's cool!
Thank you! On week 2 with HA. I have HA Yellow Standard. Your tutorial has helped me set up successfully! I was going mad, but think certain motion sensors were not working for some reason. But have this set up in another room perfectly. Thanks so much.
Great to hear!
Thank you so much for this tutorial as well as the how to use motion sensors properly. I must have tried 10 or 15 times to figure this out, and watched and read just about the same amount video/HA documentation, and blog posts. You are an excellent instructor.
Junkie, you are the best with your step-by-step explanations. I was going crazy trying to figure out how to do a single automation with 2 triggers and 2 actions.
Thank you :)
Thanks for the compliment! 🙏🏻
Zoals steeds een heel verzorgde en duidelijke video...hartelijk dank ! We weten weer wat gedaan 😉
Dank je wel voor je steun!
Thanks for this video. I haven’t seen any other HA people on YT talking about trigger id’s. I learned something new today. Cheers!
That's so cool to hear!
Thank you! Very useful info.
As someone who is just starting out with HA your explanations are really helpful- Thanks!
Great to hear! Yes, I am trying to help people like you who start with Home Assistant to get you as enthusiastic as me! 😊 It's a great platform!
@@SmartHomeJunkie So there is one thing I do not understand- in your example the light turns on when motion is detected and off when no motion is detected- I assume the amount of time it takes to turn off is based on the motion sensor default- How would you tell the light to stay on for X minutes before turning off? Would you use "duration (optional)" choice on the light-off trigger or would use a condition or would you use the transition option in Actions? Thanks.
@Joseph Anthony Indeed, you can place a delay action before the light.turn off service. This way you can use a delay time of your choice.
Yet another great video. I was struggling to get a boolean to trigger because I couldn't find a way to select it and change the state but going the other way where I did a call service ==> input boolean: turn off ==> with my boolean being the target made it work.
Thank you for your explanations. You are a good teacher
Thank you for the compliments!
I haven’t use automations for a while since i started using nodered but now i’m tempted to use it again with trigger ids. This is gonna make everything a lot tidier
Thanks for this. Working through my first sets of automations and was wondering how to combine on/off start/stop events into one automation. Good work.
This was very helpful, trigger_id's finally clicked after watching this. Been re-doing a bunch of my automations and successfully combing them into one. Thank you!
Great to hear!
Just what I needed, thank you! - I was trying to modify an existing automation that already had a single action defined, so completely missed the _choose_ action and couldn't figure out how to get the separate sets of actions into the automation. All working now though, thanks to the video.
Fantastic! Glad that it helped!
Well, I did not know this was a thing. Re-did all my automations, much cleaner. Thanks!
I never got my head around triggers, but I understand now. I spent the last couple of weeks building HA back up from scratch as my instance kept crashing with no explanation. I didn't like any of the blueprints for the Aqara Cube, so I started last night extracting attribute for what face side it was on, however that would have meant multiple automations. Thanks to you I can do one automation for all the features on one side. Your timing could not have been better. Thank you.
That's brilliant! Great to hear!
Just got my Agara cube with conbee II and using the agara blueprint. It's a bit glitchy, but working. How does this new video improve it? Thanks
@@antoniodecrisci2369 I am using Zigbee2mqtt with Sonoff dongle, like you say the blue prints can glitchy. Using the face attribute the automation defines what face is up. There are many different actions per face, each action would require a separate automaton, Using trigger IDs can put all the triggers and actions in one Automaton, One face will represent one automaton for all the actions available on that face. So instead of having 54 sperate automations, you just have 6. I hope this helps
@@davidlangley833 thanks for sharing. I must be missing something because at the moment I have one automation entry created and it does about 10 different things, for example it dims and brightens my main lights, open and closes my shades, turns on my fan heater and off, streams music. And with one shake it stops or turns off all these entities. That's maybe 10 things in one automation, using the standard 57 move blueprint. Does this sound correct to you?
@@antoniodecrisci2369 That does sound correct, if necessary I could use all six faces in one automaton, but for me that becomes complicated to follow. Included in 57 actions are turning from one face to another, for example face 5 to 1 or face 3 to 1 etc. which increases the number of auctions. The' basic' automations on one side is 7 actions x that by 6 facesthat is 42 actions. Using the examples above that increases the number of possible actions. My personal coding skills are not great, but using my automations instead of blueprints gives me more control to fulfill my use case. Blueprints are excellent, don't get me wrong and anyone coding the blueprints are incredibly talented. I think I like to know how yaml works hence I will try and do my own automations. Again I hope this helps.
Awesome thanks, now to update all my automations 😂
Since you published this video, a lot has been changed in Automations. Can you please create an updated video about this topics?
Yes!!! Thanks! Haven't even watched the video yet, but I'm looking forward to seeing your breakdown after last week's video and comment discussions.
Thank you Chris. I hope it helps.
@@SmartHomeJunkie So far, so good. Just combined 3 Automations into 1 using Trigger ID's.
Odd question: when adding additional conditions, is it necessary to use "AND"? Do you know if, when there are more than 1 Conditions (i.e. Trigger ID and Sun), the default is AND or OR? Below is a yaml example:
OPTION 1 (using AND)
- choose:
- conditions:
- condition: trigger
id: back_door_sunset
- condition: and
conditions:
- condition: sun
after: sunset
OPTION 1 (not using AND)
- choose:
- conditions:
- condition: trigger
id: back_door_sunset
- condition: sun
after: sunset
@@KaleoMgmt Great!
Very gooood ! Thank you for this new tutorial, I didnt know this awesome possibilty, I already decreased the number of my automations 💪👍
Superb! Nice to hear that it helped Phil! 👍🏻👍🏻
Thanks for a great video, helped me a lot with setting up a more advance automation in HA.
Excellent, this will probably help me eliminate about a quarter of my automations!
I'm glad I could help!
The only thing I can say is.... You are the Boss!!!
nice and easy tutorial, thanks
Thank you so much Mr Smart Home Junkie! Much appreciated!❤❤❤
You're welcome!
Thanks so much for explaining Trigger IDs. Also l had no idea 'Choose' even existed.
Great that it helped. This can be very powerful to create automations that handle multiple scenarios in one!
just spent several days chasing my tail not able to get a complex automation to turn off on no-motion trigger. As per usual, check to see if Uncle Ed has a tutorial and problem solved in minutes!!! :)
I never thought for a minute that my no-motion trigger should go at the top of the tree and then be referenced as a later option - initially that's counter-intuitive to me - I've been adding it as an action (wait for trigger)at the end of all my if/then/else conditions - and failing every time.
With this method though, when I ran it from the UI, it showed it had taken a third option and done nothing, that's all that showed up in Traces, so I thought I'd done something wrong. BUT, walk into the room, correct scene comes on, leave room and get back to laptop to check and it's switched them all off! :) Thanks yet again mate!! :)
You're welcome!
@@SmartHomeJunkie I wrote YAML for 15 binary sensors to create time slots based on sunrise/set, because sun isn't available as a helper, only time.
But watching this, I think I could have just had multiple trigger IDs based on sun instead and done it all in the UI - I'll give it a try, as it'd be easier to share as a self contained blueprint instead of code.
Every day's a school day!!
Nice one! Time to clean-up automations. Thanks!
You're very welcome. Yes, you will diminish your automations for sure! I had one case where I could replace six automations by only one! Woohoo! 🎉
Thanks! I am now using Trigger ID's. Thanks for your help!
No problem
Thanks
Thank you so much for your support 🙏🏻
Many thanks for this. I've built three smart power strips each with four sockets which are individually switched using ESP modules and ESPhome. All 8 sockets on two of the strips come on at 2:00 am when we have cheaper electricity. The 4 sockets on the third strip also come on at 2:00 am but only if an input boolean is set (used mostly to charge power tool batteries, so infrequently). All 12 sockets turn off at 6:00 am when electricity costs more. But two sockets (one on each of two strips) are dedicated to charging phones (one for my phone, and one for my wife's phone). So each of these two sockets will turn off if the individual phone status shows not plugged for two minutes. Also, each one will turn off if the respective 'phone battery level reaches 95%. Two further sockets are dedicated to charging laptops and will turn off after 2 hours (the time it takes to charge each one from almost flat). Finally, one socket is dedicated to fast charging 18650 batteries and will turn off after one hour. To achieve all that, I had 11 automations but after watching your excellent RUclips video, I have everything controlled with a single automation. So many thanks and keep up the good work and I'll certainly buy you a coffee. I have my own RUclips channel so I know just how much time and effort goes into making these videos.
Ian
Thank you, Ian.
I really appreciate this! And indeed, creating a video takes a lot of work. I don't think many people realize this.
This is great. Helped me a bunch with setting up new automations with my Zooz lights.
Excellent, simple but effective. I can get rid of a few automations now. Thank you
Glad it helped!
Danke!
Nice example of the use of multiple triggers. You mentioned in the text that we could ask for a specific automation. Well i have one:
I use a Xiaomi curtain motor in the bathroom window. I would like to open the curtain at different triggers depending on the season.
Eg in summer it should open at time 07:45, but in the winter it should only open at eg 09:00.
At the moment the opening happens at a specific time. And closing works on sunset with an offset.
But the combination of season and time, with for each season a different time is what i am not getting right. Would be great if you could help me with that.
Great use case! I’ll look into it.
This was so helpful-thank you for this!
Great to hear that it helped! 👌🏻
Thanks a lot for this another useful video. I had decided to use Node Red since I can put one group of automations together in one flow. The idea was that I would have a better overview. But experienced that it's dificult there to deal with boolean logics and you have sometimes have to convert values etc.
As far as I can see it's possible to create a group of automation tasks in one automation using trigger-id's which is excellent. So I have now decided to bring over my Node Red automations to home assistant automations.
Good choice!!!
Wow very interesting!
I have no idea of this feature.
Thanks a lot!
Saludos!
Hi! Welcome back 🌹
Thank you Jessica! 🙏🏻
This is a great tutorial. Would it be possible to do a slightly updated version to show the current Home Assistant setup? Although still similar, there are some differences now.
When you click the 3 dots on the trigger now, the option is called Edit ID rather than Edit Trigger ID and then you get the Trigger ID field.
Another Awesome Video! Glad I found it! Answered a lot frustrations I had on doing this.
Thanks for the video. I've been combining automations and they are working.
Thanks for the nice and clear tutorials. It helped me a lot to develop my boards and automation. It’s an addiction this HA. Keep continue the nice video’s.
Thanks Erwin. I hope I can continue to do this for a long time.
I love your style and method. Keep up the great work.
Thank you V J! Cheers!
Amazing. I think I love you. Subbed.
Great i wan thinking about how to organize my many automations, this is a great option thanks.
Thanks for your support!
Hi I like your videos it's very helpful. I wanna ask why did you choose Call service and not choose Device then select the device itself?
Thanks. I used call service because it's a light group and not a device.
Thank you, your video helped me a lot. Keep going :)
Thank you. Great to hear!
Thanks Ed, this is great. I have just subscribed :)
Thank you for your support Ben!
Great info. Thanks.
Thank you for the compliment!
Good tutorial. Although, I can do this in HA without trigger IDs but with device and it still works. I am not sure if HA recently made an update to automations to make them better. I am currently using one automation to turn on/off my garage lights without trigger id. Is there any benefit to trigger IDs now?
My next step would be to group my garage doors together to turn on/off the lights. I am not sure if trigger id will allow for easier grouping.
Ps: it funny that I used one of you videos to setup my motion sensor lights and you used trigger ids but I was too lazy to watch your video on trigger id and used device instead and it still worked. That how I found out. Now, I came to your trigger id video to understand how it works and it looks easy. Lol
Great video! I think I've watched it 4 times over the past few months! Question, maybe a bit off topic, why do you use "call service" instead of "device" then "turn device on/off" entity?
If you use call service, you often have more options.
Thank you, very usefull
You're welcome!
DAM.... Thank you for your videos.... I'm LEARNING A LOT.... LOVE HOME ASSISTANT...
Thanks for a wonderful job you are doing. -
What if I would like the action of a climate "preset mode" to be like the actual helper "Dropdown" mode.
Bedankt voor de duidelijke uitleg.
You're welcome jdep0 ☺️
I'm new to HA, so maybe something has been added since this video. An even more powerful feature is to use 'automation trigger variables' to handle multiple states or even multiple entities. For example, the on/off state of the motion detector is available as trigger.to_state.state. The entity_id is available as trigger.entity_id. You could pass the motion state directly to the switch service with no conditional logic. If you're clever in naming your entities according to a pattern, the same automation could handle ALL your motion-controlled lights. There are way more trigger variables than alluded to in the documentation. Once your automation has been triggered at least once, click on TRACES at the upper right. Then click on the 'Changed Variables' tab. You can use any of those variables in your automation. I do use Trigger IDs to introduce associated data. For example, you could set the trigger id to the entity_id of the light you want to control. Again, this eliminates redundant logic. The automation is driven mostly by data rather than code. I don't know if people are exaggerating, but you shouldn't need 100s of automations. At some point you must be repeating similar logic?
Wow, this is cool, time to move back from Node-RED.
Thank you!
You're welcome!
Gives me a better idea on what the Trigger ID's did, I was hoping it would help setting up a trigger with another trigger, eg, if Entering Zone and then open the front door for 2 seconds then do this action, but unfortunately not... but hey... at least I learn't what triggers do... which is a win... keep up the good content.
You might want to watch this video. It's a lightly different subject, but it explains exactly how you can daisy chain automations so that they trigger each other: ruclips.net/video/sNmonuw4EHo/видео.html.
And you can use the AND action within the action part of an automation, so if you create two trigger IDs and combine them using an AND or OR in the actions part of an automation, you will get your result as well I believe.
@@SmartHomeJunkie thanks so much, I'll take a look at it today.
What is the reason for choosing "Calling a Service" as the action instead of just using a Device action?
Also, can TriggerIDs be shared between Automations? I tried it and it doesn't look like it. That would be helpful to make the triggers more reusable so they don't have to be redefined in several automations. I believe in defining something only once.
I explained in a couple of videos why calling a service is better. Mostly because you can easily swap out devices if you call a service using the entity id. This cannot be done using a device call.
OR you create a automation triggered by detecting motion which turns on lights then starts a delay and after that turns the light off. You give this automation de mode restart and it works the same.
To be honest, I do not know which way would be more or less demanding on the HA system. I just find my way easier to read and debug. Nice explanation of Trigger ID's tho!
Yeah, it's just to give you an idea of how you can use Trigger IDs. The main purpose is to show that Trigger IDs exist and that they are VERY handy.
@@SmartHomeJunkie Great video explaining exactly that!
Great tutorial, thanks! I understand that combining automations reduces the number of automations. Are there any other benefits to combining automations using triggers?
It gives you a much cleaner overview of all your automations if you have one automations that performs several tasks for the same device. I had loads of them and sometimes it was very difficult to find the one that I made for a specific device. Now I have much less automations which makes my workflow a lot quicker.
Hi there, appreciate your videos that are super helpful for beginner me.
Question: Do you have a video or can point me to how you added the bulb/light controls? ie. The transition time, RGB value, etc.? I have a basic setup with a Smart Life RGB bulb HA but I cannot see all these options and it limits what I can do.
Thanks. You have to enable advanced mode in HA to see them. It's in your user profile settings.
your videos are wonderful. Can you help with Latest version HA Alarmo setup please?
Thank you. I will put it on the list.
@@SmartHomeJunkie YOU ARE THE BEST. Thank you.
Great tutorial, I am new to home assistant and have followed your tutorials when learning anything to do with home assistant so thank you, but I'm having an issue where once the light has turned on it will turn itself almost immediately, I've checked but cannot see why, do you have any idea why.
Question: could you use this trigger_ids in other automations as well?
Nope, they can only be used in the automation where they are declared.
can you create automation that uses time event to start Power switch to turn on my Xmas lights at 4pm and off at 10pm but only Monday to Thursday and Friday Saturday & Sunday start at 4pm still but turn off later say 11:30pm please , I am at a loss was trying to use time patterns also but no luck !
Yes, you can. You can select weekdays in the condition.
BTW excellent videos. I'm learning a ton with you! Question: in the case I have motion sensors that I want to turn active when the sun sets but offset by time how do I do that and where? This video shows something similar and could see the offset feature but this is not I need. My offset is for the sensor and not the light. Hope this makes sense
Great tutorial !! would it be possible that you make a video for blinds control...?
If I had blind controls then yes. I do have something in the pipeline. A company sent me some devices that I have to check out first.
I just found out, that you can copy each trigger. This makes it much easier to click them together. Just press the three dots and choose duplicate.
Great video, thank you for putting this together. I am curious, any particular reason why I should pick Call Service instead of the Device? I usually pick Device>Kitchen Light 1>Turn On...
With call service you have more options and you do not depend on a device ID. If you have to exchange a light later on, the automation still works if you use call service. It won't if you use the device because of the needed device ID.
Nice video but with time conditions it can also go wrong
If the trigger is a sensor and condition that lights can go on and off only between 8 and 9 for example. Most of the sensors has already a time delay for 1:30 min
What if time is 8:59 and sensor is triggerd light will go on. but will never go off again because of the time delay of the sensor and after 9 the automation will not run
That's not the point of the video. The point is to show how trigger IDs work.
Good morning - always follow your tutorials. I set up the motion activated light just as yours. In rare cases, when the light is turned off triggered by the light_off, the light will not be triggered by the light_on until wait for some time. I was wondering if it's because both light_on and light_off are almost triggered at the same moment? And the light was triggered by light_off and missed light_on, so the next light_on trigger has to be waited for. thanks!
Are trigger ID's unique to an automation? I want to have 2 automations to control 2 different Hue dimmer switches (4 buttons). Could they both have Trigger ID's of "button 1 short press" (as an example) or do they need to be globally unique?
Yes, you can use the same trigger ID in multiple automations. They are bound to the specific automation.
Top notch!!
Thanks 👍🏻
Hi and many thanks for this nice and powerfull tutorial👍
Creating "global" trigger id's, we can use in multiple automations, is not intended or planned....?
This could also make the work easier when specific triggers will be used more often.
No, and I don't think it will work either. If two automations run at the same time, the trigger IDs might get mixed up if they were global.
So the Trigger ID lives within an automation so to say? Like you created a Trigger ID within the automation, and this Trigger ID cannot be used/called upon in another automation?
Many thanks for your video (and the one about sending email notifications using GMAIL). Oddly I can get the Aqara water sensor to email but can't get the thermometer to send an email if the temperature gets above a certain point. My question relating to triggers is do I set a trigger/automation based off devices or entities as the sensors appear under both.
Thank you for a great helpful video, I have managed to do a Automation to setup a Shelly Button 1 but on doing so I m having to wait 3 mins between each press of the button for light to turn on or off? Im also trying to find a way to send to mobile and my location with google map and for it to ring or text the location is there ways to do this. Thanks
What a great tutorial again! I follow your tuts with great interest. Thank you for making these tutorials.
I have a question however, slightly related with this topic.
I have an automation, where i use two different times and a template where these times are being used. I would like to use variables for the times, so when i change the times in the automation, the times in the template will also be changed. Now i have to change the times on two places... Do you perhaps have a solution for this?
You might want to use a datetime helper to store the time value and use that?
@@SmartHomeJunkie OK, never used helpers... But i am watching your tutorial about helpers: ruclips.net/video/2tRZ_WA8Xyc/видео.html
Trying to use that for my issue. Thanks for your great tutorials!
Good tutorial. I like the idea of trigger IDs and I use them, but it isn't clear to me to what extent it is smart to use them. The more complicated an automation, the harder it is to get you head around how it works. Especially if you haven't touched it in a while. more atomic automations may be easier to debug.
What I normally do is draw a schema of the automation I'd like to create on paper first. After that I am building it up step by step and test every step. I have done pretty complex automations that work very well, but sometimes it took a while before I got it to work perfectly indeed. And yes, you don't have to use Trigger IDs for everything. In some cases multiple automations will make it easier to develop the goal that you want to achieve.
Hi, In your video you are placing a general condition to work only been 9 AM and 9PM. In such case if there is continuous motion at 9PM wont the light always stay on? Is there an elegant way to avoid this?
Thank you for your comment! In such cases, it's important to consider using a motion sensor with adjustable sensitivity or a timer function to avoid the light staying on all the time. Anyway, as long as there is motion in a room, you do want the lights to stay on, don't you?
@@SmartHomeJunkie Yes light needs to stay on but it should not be indefinately on since the condition of 9PM prevents its turn off action.
@@viggyprabhu Ah, I understand what you mean! Good find! Yes, in this case, you can move the condition to the Then Do section and add it only as a condition to the turn-on Trigger ID part.
@@SmartHomeJunkie thanks for taking time to respond.. it works like a charm 👌
@@viggyprabhu Awesome!!!
Wow been trying to get this worked and failed until watched your guide
Great Video Thanks :) What is your card to the weather (first card you have) ? thankssss :)
It's the animated weather card from HACS
nice video and walkthrough and nice automation, but i have a problem with it, i use it with condition sun, if it gets triggered just before the condition expires, and the off trigger is after condition, the light is on all day. how do you avoid it
Hi! Add the condition to your action instead of in the conditions area.
Really great tutorial - I have 10 blinds in my house that open at sunrise, close at sunset - each with a 3 min offset from the other - can I define all 10 in a single automation using trigger Id's ?
Yes, you can!
@@SmartHomeJunkie So I have not nested those automations yet, working to ensure that I get the format down correctly. In all of these where I'm using the Trigger.id I'm getting an error of: "Stopped because of error" "required key not provided @ data" - I'm not sure what this mean. Along with this I have two, yep, two Entity options available (two separate lines with an Entity drop down with the word Entity in different fonts) Is this correct ?
@@archiemarper I don't know why you get the error. About the two entity fields, you are correct. Since two versions ago it's possible to add multiple entities to a trigger in the ui. It was already possible in yaml, but you see this in the ui now too.
@@SmartHomeJunkie No problem. That make sense!!! For now I've disabled these automations as they don't run to completion and I'll play around with them over the weekend. Thanks
Final reply and again I do appreciate your hard work in this and other video's you have created. A great user from Reddit @PierogiMachine discovered that I did not have any data in the second sequence. In other words, since these are blinds, sequence 1 has a Cover: Set Position open value of 50, however, sequence 2 has a Cover: Set Position closed value of 0 (zero) (which leaves the automation to interpret that as a null value when looked at in YAML). When I changed that second sequence to 1 for Close the automation ran successfully.
Do you have videos for infercaing with Ecobee thermostats? I need an automation that controls batching my Ecobees at ince. I can't seem to control the fan function alone. I would use this to create a Fresh AIr Function.
Good Day - just followed your video and set up an automation to trigger a light on/off based on motion - worked perfectly - except for - in the action section, all my home rooms show, except for the Guest Bedroom - which is where I setup this automation (I had to select the actual light switch "device"). I verified the light switch is in the area/zones for the house, the light switch and motion detector are assigned to the guest bed room, I have restarted and reboot HA, but the Guest Bedroom does not show in the Call Service choice of this automation. Your help is appreciated.
Well - just learned, that lights and switches are different. My guest bedroom "light switch" is actually a "switch" entity. When in Call Service, if I select "switch", the guest bedroom shows up. All is good. At the very least - thanks for listening...it helped me learn the difference between switches and lights...as entities. in
fijn bedankt heel duidelijk dat is wat ik zocht 😉
Top! Mooi dat ik je heb kunnen helpen Benno!