Sorry this ended up being WAY longer than I anticipated and bit more of a raw format than usual but hope it's useful for you, now get out there and template! 👊
@casperheintzelmann31083 жыл бұрын
Dont worry! Home Assistant fans are not attention-challenged like squirrels or teenagers! Good job, thanks!
@DoNotKillThePresiden3 жыл бұрын
It really was helpful. Gonna template a lot 😁
@mateojbuteler89743 жыл бұрын
Hello! :D Do you know if i can create an automation or some sort of switch, that edits a .yaml when i toggle it? Thank you!
@EverythingSmartHome3 жыл бұрын
Hello! Hmm I'm not sure to be honest, sounds complicated!!
@mateojbuteler89743 жыл бұрын
@@EverythingSmartHome What i want to do is hide a tab under a password... I created a dummy alarm, added an alarm card, and an automation that detects when the dummy alarm is disarmed, and then shows the "secret panel". That's a lie, i haven't done that, i just want to. lol
@whanauof53 жыл бұрын
Templates are tricky. Best explanation i've seen on the subject. Thank you for taking the time.
@EverythingSmartHome3 жыл бұрын
Thanks, appreciate your support!
@pucbaldwin3 жыл бұрын
This was one of the most useful Home Assistant tutorials I've ever seen. Been trying to understand templates for a long time.
@EverythingSmartHome3 жыл бұрын
Thanks Peter!
@JoseBerruezo3 жыл бұрын
Nice work, this is a complex subject, I hope you continue with this topic and get to intermediate and advanced as well.
@EverythingSmartHome3 жыл бұрын
Thanks Jose! If you have any requests for more advanced ones let me know!
@tenelitebrains3 жыл бұрын
Perfect timing! Literally just trying to work out what they are and how to use them and boom, I get your notification from KZbin 👍
@EverythingSmartHome3 жыл бұрын
Mind reading abilities 😳😂
@prebenborg3 жыл бұрын
This by far the most useful home assistant video for a long time. The Templates have given me and others terrible headaches over the past. This was SO great to see how you in 26 minutes could explain it so simple. I have personally been beaten up when asking about templates in the HA discord support channel. A very unpolite forum
@EverythingSmartHome3 жыл бұрын
Hello! Thank you very much! Glad you found it useful! Sorry to hear about that on Discord, please do feel free to join our discord, we have an amazing bunch of guys who all help out and of course I spend lots of time there too!
@slandshark2 жыл бұрын
This video saved me a ton of headache and time. Thank you so very much! I wanted an easy way to lump all my door sensors (states) into a single template that I could copy/paste into different automations and after just 7 minutes of the above video I had all the answers I needed to make it happen. Super straight forward tutorial, thank you!
@gabioancea47692 жыл бұрын
The most easy to understand video regarding templates in Home Assistant. Great job, you are the best !!!!
@EverythingSmartHome2 жыл бұрын
Thanks my friend!
@pavolholes3 жыл бұрын
I’ve been templating in HA pretty heavily, but I’ve never seen a tutorial on it yet. Thanks a lot for showing me the basics which I apparently still didn’t understand (i.e. difference between ‘{{‘ and ‘{%’ ) and also showing me something new and that’s setting a parameter of a new binary_sensor. Very usefull. Thanks once again!
@EverythingSmartHome3 жыл бұрын
Thanks Pavol, glad it was useful! You can use it for all domains, binary sensors, sensors, lights, switches so definitely useful to know! 👌
@jmr2 жыл бұрын
There are good HomeAssitant yaml videos out there but you're right this the best "templating" video I think. Reasonably short but gives good core knowledge.
@dudefromkeene2 жыл бұрын
Also I need to thank him for telling me the difference between False and false. One is a statement the other an input boolean. I would have never noticed that!
@makernix Жыл бұрын
Thank you for this very clear video ! I will make a video for my French viewers and your the only one who explain for the very beginners
@MrNebukad643 жыл бұрын
Finally I started to understand templates in Home Assistant - the documentation was mythical to me. Thank you! Subscribed immediately ;)
@EverythingSmartHome3 жыл бұрын
Thanks Sven, glad it was useful!
@WiseInetellect3 жыл бұрын
I thoroughly enjoy learning how to fully utilize the home assistant platform from your videos. Thank you very much for all your time and effort!
@EverythingSmartHome3 жыл бұрын
Awesome, glad you enjoyed them!
@GeneralTJP3 жыл бұрын
This video was fantastic, i now get how to read code with if and for loops. Explaining the syntax was super helpful. please don't stop making these videos.
@EverythingSmartHome3 жыл бұрын
Thanks TJ glad it was useful!
@Dox-IOT3 жыл бұрын
Hi! I absolutely don’t regret it getting longer! I look forward to next Tuesday! 😄
@EverythingSmartHome3 жыл бұрын
Thank you friend, appreciate it! There might be a little break in TTT for a while but we shall see 😅
@Dox-IOT3 жыл бұрын
@@EverythingSmartHome I hope the break won't be too long! I became addicted !!! 😊
@buenology2 жыл бұрын
I stumbled on your channel and I just wanted to thank you for everything that you do. It has greatly helped me. Thank you!
@hansnorling3 жыл бұрын
WoW! Great lesson. Calm and methodical, you got what we beginners need to be able to get templates with all magic {%%} And you repeated this a lot, repetition is the mother of learning! Very well done. Thank you very much!
@EverythingSmartHome3 жыл бұрын
Thanks for the kind words, glad it was useful!
@PM135012 жыл бұрын
Lewis, this is indeed your best video from my perspective. Two months after watching this video, I have become a power user of template editor and using templates in scripts, automation & integrations. It is really a cool, elegant and very powerful concept once you grasp the fundamentals of it - thanks for explaining it so clearly!!
@EverythingSmartHome2 жыл бұрын
Thank you sir, appreciate you saying that!
@PM135013 жыл бұрын
Excellent video, one of the positive outcome is that I have started to use template editor a lot more!!
@EverythingSmartHome3 жыл бұрын
Haha nice!
@remimetivier4395 Жыл бұрын
Great Vid. Just wish to clarify that: {{ ... }} are to be used for Expressions (Basically a value that you want to print out) {% ... %} to be used for Statements (When you use a bunch of expressions or other statements together to execute something... like if/else/loops)
@gildaslefur24353 жыл бұрын
Great video, I like this format and I don't mind the length of the video. Very well presented. Now I feel confident I can create my own templates and even new sensors. 👍
@EverythingSmartHome3 жыл бұрын
That is great, thanks for your feedback and glad it was useful! Thanks for the support!
@RobertAnthonyPitera3 жыл бұрын
I think I remember promising to check you out in a reddit sub; watched once and subbed. Been watching ever since. Congrats on 10k!! Please don't worry about the extra time on videos that deserve the time. Would LOVE to see you do more on this subject as well as one on MQTT; a subject I never quite seem to understand as well as I would like.
@EverythingSmartHome3 жыл бұрын
Thanks Robert, very much appreciate your support! I'll try and get to that hopefully one day soon!
@PaulMeredith3 жыл бұрын
Brilliant Video, just what we needed after the Image Processing vid... Not really touched templates so that give me just what I needed. Keep up the great work !!
@EverythingSmartHome3 жыл бұрын
Thanks Paul, appreciate your support! Let me know how it goes! 😅
@asbjborg2 жыл бұрын
Aaaand there it was. The magician who finally allowed my mind to wrap around templates in HA. Thanks a bunch, you have saved me endless hours of scouring the internet.
@alejandrolazaro33552 жыл бұрын
Nice job ! me fue muy útil, me encanta que la explicación vaya de la mano con la práctica eso facilita la comprensión del tema. Nice job! It was very useful to me, I love that the explanation goes hand in hand with the practice that facilitates the understanding of the topic
@fredrik3543 жыл бұрын
Your guides are very helpful, enjoyable and well made. Good stuff :)
@EverythingSmartHome3 жыл бұрын
Thank you sir!
@PhilipJonesPMJ2 жыл бұрын
A really useful and complete tutorial. It showed me exactly how to use the templates I created in my configuration.yaml.
@EverythingSmartHome2 жыл бұрын
Glad you found it useful, thanks for the comment!
@kjelle3923 жыл бұрын
Thank you! Finally, I actually understand what templates i HA really are and how useful they are :)
@EverythingSmartHome3 жыл бұрын
Glad I could help, thanks for commenting!
@liveartrainbow3 жыл бұрын
Great work . Thank you for sharing and making knowledge available around the globe
@EverythingSmartHome3 жыл бұрын
Thanks for watching!
@ntq1ty3 жыл бұрын
Nice job! Templates have always seemed unnecessarily complex compared with just writing a few lines of python, but your interactive testing process and examples show it's straightforward once you know the syntax. I'd love to see more of the technical yet powerful tutorials. Maybe a video building on this one about how to integrate a bunch of MQTT topics in to a single sensor with attributes would be useful to viewers? I presume that could be done in a similar way to this tutorial using templates and would make MQTT devices more equivalent with first-class sensors within Home Assistant. A possible general example might be using one of the linux lm_sensors to MQTT scripts or IOT Link for Windows and displaying a graph of multiple sensors in Home Assistant?
@EverythingSmartHome3 жыл бұрын
Thank you! Yes it is all about knowing that syntax isn't it, but getting there can be difficult! Thanks for your ideas, I'll certainly try to take them forward, I didn't think this video would be popular or I explained very well but seems people really enjoyed it so I'd be happy to add some more examples!
@bmhsk3 жыл бұрын
Thanks so much for taking time to do these tutorials. Nicely done and explained well!... Now a question on your use case with presence detection based on license plates... How would you detect if its coming home or leaving? - Wouldnt it pick up the licenses plate and set it to home - if its leaving in this scenario? - How could you solve that problem? ... Anyways - Thanks again!
@Tekwyzard3 жыл бұрын
Something like, if already home, assume leaving, if already away, assume arriving??? I haven't a clue how you'd do that via templates though, they're still very much a black art afaic, until I try using them more.
@slandshark2 жыл бұрын
@@Tekwyzard That sounds like maybe the 'helpers' under configuration menu might help here (no pun intended). I believe helpers are basically variables you can set/update as needed?
@Tekwyzard2 жыл бұрын
@@slandshark Probably, yes. I use quite a few boolean 'helpers' for stuff myself, to set, remember or toggle states of various things, and some number inputs and other ' helper' whatnots for controlling when automations happen. As for doing the same using templates, the topic of this video, as I replied to the OP, I haven't a clue, apart from suggesting a possible work flow. I just flounder around trying out templatey stuff I find on the interweb, trying and often failing to adapt them to my needs, while usually spectacularly failing to come to terms with any of the obfuscatory syntax they use.
@gzxto3 жыл бұрын
Thanks a lot, by far the best video about templating
@EverythingSmartHome3 жыл бұрын
Thanks Thomas, glad it was useful!
@realmisterkorea3 жыл бұрын
Thank you! That was incredibly digestible for someone just dipping his toe into Home Assistant!!!
@EverythingSmartHome3 жыл бұрын
Thank you for watching, glad it was useful!
@pratahsinnetamby3 жыл бұрын
Brilliant video once again - many thanks.
@BallsworthBallsbury Жыл бұрын
Lewis, I'm a huge fan of your channel. Thanks for everything you do for this community! That being said, your misuse of "statement" and "expression" in this video is driving me mad. You swapped them ;)
@carlnakamura48613 жыл бұрын
Great video and a given addition to my Home Assistant Learning playlist👍🏻 Like you said, I think this is borderline to an advanced topic for people like me who are not developers or coders but very pedagogical so even I can follow but will have to practice a lot😊 Please consider making videos on how to create custom Lovelace cards to display all these new sensor attributes
@prebenborg3 жыл бұрын
A suggestion for another video could be the Statistic and history-statistics. I actually wonder if it's possible to make groups of sensors (statistics from all my motion sensors) and extract statistics of the group entities so I don't I have to make a history stat for each one of them. But a video on how make statistics based on things like a motion sensor. Like time of last movement or total no. of movements today etc. would be great
@EverythingSmartHome3 жыл бұрын
Thank you for the suggestion!
@Bonaur2 жыл бұрын
Great introduction, I learned a lot. But how do you set/assign a value to an entity state ? I have a value that I need for later calculations. How do i write a value to that entity.state, or is there another way of storeing values for later use ?
@rob19713 жыл бұрын
Great video again Lewis, thank you!
@EverythingSmartHome3 жыл бұрын
Thanks Rob! 👍
@rob19713 жыл бұрын
@@EverythingSmartHome still playing catch up... 😂
@firebladejohnny Жыл бұрын
According to HA Templates, this refers to legacy configuration. Do you have or intend to do an updated tuition on templates? I'm struggling to assign an area to binary_sensor. cheers
@jmr2 жыл бұрын
I knew I was getting attributes in a way the was suboptimal. Thanks! I know this was just an example but when you rounded to 2 places, multiplied by 100, and didn't change the float to an int that was killing me! 🤣
@kolia563 жыл бұрын
This is definitely a must read. Thank you so much, impossible to understand templates and the relationship with other HA components without the nice tutorial. However I'm having a little trouble. The action is a service rest_command to which I want to pass values that I get from the template. So how can I reference in the data section of the action a value that is retrieved by a template . I tried many flavours like (under the data section) status: {{test}} this triggers a validation trigger, I tried status: {{"test"}} that sends an empty string, I tried test, that sends the string "test". test is defined in the template section as: {% set test = states(''alarm_control_panel.5656_ccc_zone_4_alarm'')%}' The template works fine, it is tested in the developper section. Thanks again for your dedication to HA
@TheVictoire223 жыл бұрын
thanks man! very inspiring and educative the missing part for me!
@EverythingSmartHome3 жыл бұрын
That's great, glad I could help!
@fearthesmeag Жыл бұрын
Hey Lewis, Ive been following your Mushroom dashboard tut, and noticed you used total lights on. How would I go about setting this up as I presume this is a template as well?
@chrisw1462 Жыл бұрын
Not everyone has a large screen. Reading this on a regular HD screen is a PITA. On top of that, tiny text in dark blue on a dark background is even harder to read. There are magnifier apps for streaming, or you could do it in Post.
@brianmoulson55123 жыл бұрын
Great video, helped me a lot.
@EverythingSmartHome3 жыл бұрын
Excellent, thanks for the comment!
@ansomeBob3 жыл бұрын
Excellent tutorial, thanks
@clairerovic2 жыл бұрын
This was a wonderful video, thanks for all your efforts. Hopefully a constructive suggestion, code is very hard to read, especially on a mobile. So every chance you have, can you please use the zoom. Again thanks heaps.
@EverythingSmartHome2 жыл бұрын
Thanks, indeed I've tried to improve in the newer videos to make things readable
@photelegy2 жыл бұрын
How to use templates in a card (e.g. picture-element-card) to differ e.g. the color depending on a input_boolean?
@heimdallmidgard46703 жыл бұрын
Awesome as usual. Maybe another nice video like this would be Appdeamon.
@EverythingSmartHome3 жыл бұрын
Thanks! And thanks for the suggestion!
@fredrikjerneskog21333 жыл бұрын
Would it be possible to make a device_tracker assigned to a person and have it toggled with a boolean, using a template?
@laurentweisgerber3846 Жыл бұрын
I saw you had toggle buttons in front of your automation, how do you do that?
@jkeltonga19 күн бұрын
You do a great job on your videos but unfortunately, none of the content on KZbin is relevant any longer because of the changes that have been made to HA. I am unable to get templates working because there is no content available for the current version of HA. Not even the HA documentation is up to date, so I am stuck.
@rajmohanjena1093 жыл бұрын
Please do a video on interfacing servo with esphome or tasmota on HomeAsisstant
@soloyopuedohacerlo3 жыл бұрын
Hi! how can i catch an specific portion of an Third party app notification on my android phone? i mean, i want to catch a notification from my IPTV app, but i comes with the current time, so i need only to catch the part that doesnt change, or a way to include the current time on the template.
@arreak3 жыл бұрын
What a timing, literally need this.
@EverythingSmartHome3 жыл бұрын
Coming in clutch 😂
@louisviciedo Жыл бұрын
Great video, question how do i print an attribute further down the list i.e. I want the id at the bottom stations: count: 9 cursor: next: '8' results: - address: country: US line1: 7100 Hospital Dr line2: '' locality: Dublin postalCode: '43017' region: OH fuels: - regular_gas - midgrade_gas - premium_gas - diesel id: '140205'
@wagnerfontes23 жыл бұрын
I know I'm way too late for comments (2 months!), but your video will be helpful for ages! Thanks! In your tutorial you use specific statements, syntax etc. that make total sense in the specific examples, but for sure I will need to learn other of such elements to build my own templates. Do you have any link for a cheatsheet or just an easy-to-understand list of the most useful elements in building templates? I found links to the Jinja syntax in the Home Assistant docs, but that's too complex (for me). As my next step I'm looking for something in between your (excellent) beginners tutorial and the over-detailed explanations in the official documentation.
@EverythingSmartHome3 жыл бұрын
It's never too late to comment, I appreciate it!! I don't unfortunately have a cheat sheet sorry I just the the Jinja2 syntax myself to search for what I'm trying to do, but that is a good idea!
@DementedDog3 жыл бұрын
PS - is there a way to set a default value to handle a reboot?
@daniruiz25723 жыл бұрын
Your videos are amazing !! Thanks a lot!!! I wonder if it would be possible to know which user flipped a switch. Is there a method to find out? If I have a Home assistant at home and we are three users, could we know who turned on or off a lamp? Thank in advance!!!
@EverythingSmartHome3 жыл бұрын
Thanks Dani! You should be able to look in the history log of a device which now in the more recent updates will show you who turn the lights on it off. Hope that helps!
@daniruiz25723 жыл бұрын
@@EverythingSmartHome many thanks!! Do you know if it is possible to display the name of the person connected on a card? Example: welcome user XXX
@EverythingSmartHome3 жыл бұрын
Sorry I'm not sure!
@daniruiz25723 жыл бұрын
@@EverythingSmartHome many thanks!!!
@skynetnetworks3 жыл бұрын
Templates is the key great video
@EverythingSmartHome3 жыл бұрын
Thanks my friend!
@user-zr7kz4vs7c3 жыл бұрын
May I asked which affordable smart door lock can easily integrate with Home assistant? I have checked those DIY smart door locks videos on KZbin, but they are too difficult for me. Do you have any recommendations? Thank you!
@EverythingSmartHome3 жыл бұрын
Sorry I don't have any recommendations for you unfortunately, smart locks in the UK are a little more tricky than other countries so I don't have one yet!
@user-zr7kz4vs7c3 жыл бұрын
@@EverythingSmartHome But do you have any ideas to DIY a smart lock?
@SlackerLabs3 жыл бұрын
I can't be the only that lol'd at 00:50 ...
@dartfrogdk3 жыл бұрын
Amazing keep it up
@EverythingSmartHome3 жыл бұрын
Thank you, will do!
@metoo75873 жыл бұрын
The tool you use to edit your YAML file - what tool is that ?
@EverythingSmartHome3 жыл бұрын
It's visual studio code, available in the add-on store!
@metoo75873 жыл бұрын
@@EverythingSmartHome Well, there is no "add-on" store in my HA core container installation......
@EverythingSmartHome3 жыл бұрын
Use it on your desktop then :)
@metoo75873 жыл бұрын
@@EverythingSmartHome Great! How would you compare Visual Studio Code to i.e. NotePad++ and PilotEdit with focus on ease of use for newbees ?
@mpbianconi Жыл бұрын
Great video... tks a lot!!!
@jamiecoates98913 жыл бұрын
Thanks, but still don't see how I turn this attribute into a usable variable in node red, do i just need to add to configure. yaml? don't understand how I reformat from template test in developers to the the right format for config.yaml. example {{state_attr('device_tracker.life360_myname','latitude')}}. I want to access altitude as a variable in node red. Thanks in advance.
@EverythingSmartHome3 жыл бұрын
Node-Red is a seperate thing, sorry I don't use it!
@jamiecoates98913 жыл бұрын
@@EverythingSmartHome ok but question still same, how do I access the attribute, create template file, or just add to config.yaml. not clear. thanks
@celeritas5k2 жыл бұрын
Not sure if anyone said it before, but when programming in general if you're returning a boolean from an if statement, you don't need an if statement. Just return the condition directly - {{ state_attr('image_processing.whatever', 'statistics').calls_remaining > 2485 }}
@EverythingSmartHome2 жыл бұрын
I usually include it for completeness because this is a beginner guide and it's easier for beginners to understand if they see the full thing
@celeritas5k2 жыл бұрын
@@EverythingSmartHome I can see how it would help beginners to see "true" and "false", but I don't think that's a great way to illustrate it. You'd be better off putting {{ 2 + 2 == 4 }} in the template editor and showing that "true" shows up in the results window. The extra if statement is not more "complete", it's redundant.
@celeritas5k2 жыл бұрын
@@EverythingSmartHome Also sorry to drop in and criticize you without saying nice things - this video is seriously helpful, thanks a ton for making it.
@EverythingSmartHome2 жыл бұрын
I didn't necessarily mean just the true/false but the if statement as a whole. I'm not saying I'm right and your wrong or vice versa, I'm saying that if I put myself in the shoes of a beginner then for me personally it's easier to see the long way of having the if statement with true and false before moving to the shorthand way after. So that's why I wrote it like that, even if it is redundant. I'm certainly no programmer either but all of the courses I've taken on different languages so far have all taught the long-hand way first in the beginner section before teaching the shorthand. Just my opinion, again doesn't mean it's right
@pjotrpottervogel19903 жыл бұрын
Thank you, for a HA noob lieke me this is really very helpful!
@EverythingSmartHome3 жыл бұрын
Thanks for watching!
@jorgeanzolao3 жыл бұрын
I just waited to be the subscriber #10000 :D
@EverythingSmartHome3 жыл бұрын
Haha thanks Jorge!
@SayWhaaaaaaaaaaaaaaaaaaaaaaat Жыл бұрын
DOnt know if this exists but your loop MISSING breeak statement. Even if it finds something it will continue the loop while it ends, its not efficient. When finds it should stop looping - break the loop.
@JoelAckerman99Ай бұрын
Terrific!
@Saw-IT3 жыл бұрын
good one
@trusky773 жыл бұрын
Thx!!!
@EverythingSmartHome3 жыл бұрын
Thanks Javi!
@Diamonddrake2 жыл бұрын
Please zoom in on the page when recording code, it’s not easy to see what you’re typing
@daveclarke50853 жыл бұрын
Great video! Even an idiot like me understands it 👍
@EverythingSmartHome3 жыл бұрын
Haha glad it helped Dave!
@dab42bridges803 жыл бұрын
Templates or ten plates?
@AverageAutomation3 жыл бұрын
awesome video!! haha you need to be careful I can see you still have a full head of hair seems like most HA videos is from bald people.
@EverythingSmartHome3 жыл бұрын
Haha I never noticed before! Well you know what's happened if I stop making videos suddenly 👀
@sagetx3 жыл бұрын
This is waaaaaaaay past beginner. Where are you getting all the language from? Where is this configuration file? OK , so it's on there - What then? Call service notify? What's that? Who does it notify? How? I been beginning blocks. I A have a bunch of lights. Other than the card things ha sets, I can't do anything with them. THAT'S BEGINNER. Set some parameters on the beginning of your video. "you should know this" etc. Link to those. I'm soooo lost I don't even know what to look for.
@EverythingSmartHome3 жыл бұрын
I understand that, except your choosing to omit a key point. It says "a beginner's guide to templates" - not "a beginner's guide to home assistant". These are two very clear distinctions that your choosing to ignore. I want to help you of course, but I'm just saying be mindful of the video title and temper your expectations. If you need help then join the discord, we have lots of great people to help out!
@sagetx3 жыл бұрын
@@EverythingSmartHome thanks. Just trying to get through the weeds. You're right. Saw beginner. Assumed. I'll get there eventually.
@EverythingSmartHome3 жыл бұрын
That's OK no problem, I understand your frustration. If you need help please ask, we have a large discord community of people who all help each other, feel free to join!
@andrescalapt_3 жыл бұрын
A Like for that joke ;)
@EverythingSmartHome3 жыл бұрын
Haha thank you sir!
@sysparadox99982 жыл бұрын
Please for the love of god don't stop teaching.
@EverythingSmartHome2 жыл бұрын
Haha I'm not sure how much of a teacher I am but I'll try not to!
@bgable77073 жыл бұрын
Bravo, you made the not so obvious much more understandable and brought it into view, keep up the great work. The explanation of the Jinga syntax and the zooming in on the text is appropriate, too.