YAML & Jinja Templating Course Episode 1: Expressions, Statements, Comments, Variables, and Filters

2024 ж. 14 Мам.
10 431 Рет қаралды

Learn the basics of Jinja templating in this programming course! I am explaining everything about expressions, statements, comments, variables, and filters. This video covers everything you need to know to get started with Jinja templates and YAML in Home Assistant.
⭐ You can download all the code that I created for the course at: ko-fi.com/s/84ab3c5875⭐
Links referred to in this video:
* Jinja Template Designer Documentation: jinja.palletsprojects.com/en/...
* Jinja Built-in filters: jinja.palletsprojects.com/en/...
* The YAML and Jinja Course Playlist: • YAML & JINJA Templatin...
Blog version: www.smarthomejunkie.net/jinja...
⭐⭐⭐
* Join this channel to get access to perks: 📺 / smarthomejunkie
* Please consider becoming my patron 🏅 at / smarthomejunkie
* Or please support me by buying me a ☕ at ko-fi.com/smarthomejunkie/
* Or sponsor me through PayPal at paypal.me/smarthomejunkie
⭐⭐⭐
⭐ If you want me to create a review of your product, please visit this page for information and rates: www.smarthomejunkie.net/revie... ⭐
My Devices: github.com/smarthomejunkie/My...
Instagram: / smarthomejunkie
X: www.x.com/smarth0mejunkie
Mastodon: mastodon.world/@smarthomejunkie
Facebook: / smarthomejunkie
TikTok: / smarthomejunkie
Discord: / discord
00:00:00 Introduction
00:01:58 Expressions
00:02:25 Statements
00:00:00 Comments
00:13:08 Variables
00:05:13 Filters
#homeassistant #jinja #yaml #templates #templating #programming

Пікірлер
  • What do you think about YAML and Jinja? Do you rather want to do everything using the UI of Home Assistant, or do you like to program your own advanced templates? Let me know in the comments!

    @SmartHomeJunkie@SmartHomeJunkieАй бұрын
    • Thank you very much Ed! This is a series I have been waiting for for a long time. I'm already looking forward to the next episode!

      @Tafmie@TafmieАй бұрын
    • I want to do everything using the UI, but being able to at least understand existing yaml/jinja code is always useful.

      @jp_baril@jp_barilАй бұрын
    • I prefer YAML and Jinja. The UI is good, but I find it easier to visualize what I’m doing by looking at the code.

      @hi-ccowboy7983@hi-ccowboy7983Ай бұрын
  • Eindelijk voor mij meer duidelijkheid over het gebruik van Yaml en Jinja. Hier zat ik op te wachten. Dank je voor de heldere uitleg.

    @waltervos8537@waltervos853720 күн бұрын
    • Dank je wel voor je fijne reactie!

      @SmartHomeJunkie@SmartHomeJunkie20 күн бұрын
  • Excellent! It’s amazing how rare it is to find simple explanations for this stuff

    @singaporepastor@singaporepastorАй бұрын
  • This is great! Really looking forward to the rest of this course!

    @richardharnwell3331@richardharnwell333129 күн бұрын
  • This is exactly what was looking for. Excellent job, Ed! Thank you so much for that!

    @krzysztofkomornicki7007@krzysztofkomornicki70074 күн бұрын
    • Thanks! I'll make sure to keep up the good work to meet your high expectations!

      @SmartHomeJunkie@SmartHomeJunkie3 күн бұрын
  • This series is going to be a lot of help. Thanks Ed

    @ianrobson9612@ianrobson9612Ай бұрын
  • Hi Ed, great video. I’ve been looking for something like this for a while. Even just explaining the difference between jinja and YAML is a big help. Thanks Eddie

    @holohane@holohane12 күн бұрын
  • Hier was ik al een tijdje naar opzoek. Eindelijk Geweldig!

    @edwaaij4752@edwaaij475227 күн бұрын
  • Thanks for the Home Assistant YAML / Jinja Tutorial series!

    @halko1@halko19 күн бұрын
    • I'm glad you found the tutorial series helpful!

      @SmartHomeJunkie@SmartHomeJunkie3 күн бұрын
  • Looking forward to the rest of the series!

    @DavidDeVisser@DavidDeVisserАй бұрын
  • Another top notch video. Looking forward to this series!

    @scottwhitaker1067@scottwhitaker106727 күн бұрын
    • Thanks!

      @SmartHomeJunkie@SmartHomeJunkie27 күн бұрын
  • Thank you for this type of content, as I could not find tutorials with explanations like this. I will begin my study of these episodes this weekend!

    @wwolfram33@wwolfram3314 күн бұрын
    • I'm glad you found the content helpful! Enjoy your weekend study session!

      @SmartHomeJunkie@SmartHomeJunkie14 күн бұрын
  • Hello, just wanted to tell you that I love your channel, you do a great job explaining everything we need to make our own Home Assistant setup. I hope someday you'll reach the million subscribers you deserve !

    @dotmhd@dotmhd23 күн бұрын
    • Thank you so much for your kind words! ❤️

      @SmartHomeJunkie@SmartHomeJunkie23 күн бұрын
  • Thanks a lot for this ! Using the code is indeed giving more flexibility than the UI, if we need more advanced features to be developped !

    @cedricdelecole3964@cedricdelecole396428 күн бұрын
  • Thanks so much for this. This is great content! Can't wait for more

    @donnyf12@donnyf1228 күн бұрын
  • I am sure many HA users will love to follow your series - including me. Great work. These tutorials will certainly increase the reach of your channel!

    @stefan-lupo-pelzl@stefan-lupo-pelzl29 күн бұрын
    • Thank you so much for your support! I'm glad you're enjoying the tutorials.

      @SmartHomeJunkie@SmartHomeJunkie29 күн бұрын
  • I’m looking forward to this although I will go through each one slowly as I am a complete novice to this. Thanks Ed👍🏻

    @kevinhenryviii@kevinhenryviii29 күн бұрын
  • Thanks Ed This is great content which will help a great many, linking back now!

    @homeautomatorza@homeautomatorzaАй бұрын
  • Great job!! so clear. and super helpful. UI is great for most things, but some creative out of the box things require programming!

    @robRobblah@robRobblah25 күн бұрын
    • I appreciate your positive feedback! It means a lot to me.

      @SmartHomeJunkie@SmartHomeJunkie25 күн бұрын
  • I've been struggling with YAML and templates. This is greatly appreciated!

    @major_west@major_westАй бұрын
  • Looking forward to it. Please go deep :)

    @Shaq2k@Shaq2kАй бұрын
  • Great content, as always! The Jinja documentation is very comprehensive, however, it's a much better reference than it is a tutorial. I'm a developer by trade and still struggled with it. Your explanations of the basics opened up a whole new understanding for me, which will allow me to take advantage of the excellent reference material on the Jinja site!

    @DeliberateGeek@DeliberateGeek29 күн бұрын
  • Grate job. Waiting for next one.

    @piotrzadrozynski7197@piotrzadrozynski719728 күн бұрын
  • Thank you very much and very important and also allays concerns for new HA users.

    @ElishaiPoran@ElishaiPoran8 күн бұрын
    • Thank you for your kind words, they mean a lot to me!

      @SmartHomeJunkie@SmartHomeJunkie3 күн бұрын
  • At last, i've been looking for a tutorial about this.

    @sygad1@sygad1Ай бұрын
  • I'm not super comfortable with YAML or Jinja so I'm looking forward to these. Thanks Ed!

    @pjuhl2313@pjuhl2313Ай бұрын
  • I love these tutorial type videos. I often use someone elses JINJA for what it does, without actually understanding how it does it. This for example: state: "{{ min([float(states('sensor.solaredge_m1_ac_power'), 0), 0]) | abs() }}" Hopefully you'll go down to the level I need to understand what this is doing to my sensor value, then I can replicate it and understand it. Thanks.

    @daveforrester61@daveforrester6128 күн бұрын
  • Great video Ed, Cant wait for the rest in the series

    @emms-place@emms-place29 күн бұрын
  • The series we're waiting for

    @TonkaowGaming@TonkaowGamingАй бұрын
  • Thanks Ed, looking forward to your clear explanations.

    @drumslapper@drumslapperАй бұрын
  • Nice! It's very useful!

    @DeividasNarmontas@DeividasNarmontas29 күн бұрын
  • Wow, that is awesome! Thanks Ed.

    @sevagjb@sevagjbАй бұрын
  • 👍👍👍 sounds good 👍👍

    @manfredzimmer1199@manfredzimmer1199Ай бұрын
  • Great vid!

    @bliblabl8149@bliblabl8149Ай бұрын
  • Just what I needed! Super thanks!

    @hi-ccowboy7983@hi-ccowboy7983Ай бұрын
    • Thanks for your support!

      @SmartHomeJunkie@SmartHomeJunkieАй бұрын
  • Awesome. Thanks

    @berrnardflach@berrnardflach29 күн бұрын
  • Thanks so much Ed for the simple explanations, I'm just getting into writing some custom code...without quite understanding what it is I'm writing. Trying to do some neat calculations around my energy consumption. This first video has already given me some confidence to keep going with it. Really looking forward to the rest of the series! Hoping you might go into calculations in some depth?

    @robertdon-duncan7954@robertdon-duncan795429 күн бұрын
    • Yeah, that will be covered too.

      @SmartHomeJunkie@SmartHomeJunkie29 күн бұрын
  • Super useful. Thanks ❤

    @ericbelanger6900@ericbelanger690016 күн бұрын
    • Thank you for your kind words

      @SmartHomeJunkie@SmartHomeJunkie16 күн бұрын
  • Brilliant..

    @Nick_1976@Nick_197629 күн бұрын
  • Seems very hard 😂 I cant get the hang of templates!

    @michaelthompson657@michaelthompson657Ай бұрын
  • Great video Ed! Love it, can't wait until next video. After the hole course maybe I can leave TheFes alone 🙂

    @ictstelucjam3604@ictstelucjam3604Ай бұрын
    • Always happy to help

      @TheFes@TheFesАй бұрын
  • Looks to be a really useful course Ed. I find Jinja and the differences between {{ and {% quite hard to understand and it usually takes several attempts before I can get my code to work!

    @geoffreycoan@geoffreycoanАй бұрын
  • Is there a way to get the embed code of a live streaming rtsp ip cam running in picture glass?

    @vette5808@vette5808Ай бұрын
  • Great educatives videos as usual. Do you plan for an episode about how to deal with Date and Time in Jinja? Cheers

    @mikaellume4657@mikaellume465716 күн бұрын
    • Yes sure!

      @SmartHomeJunkie@SmartHomeJunkie16 күн бұрын
  • This will help a lot Ed, would be great if you could also touch upon calculating with values ( adding or subtracting, …) further a great video as always.

    @gerwingal4430@gerwingal4430Ай бұрын
    • That will be absolutely covered!

      @SmartHomeJunkie@SmartHomeJunkieАй бұрын
  • Very useful thanks. I did find the pace a bit fast throughout. You need time to listen to what you are saying and also take in what’s being shown on screen. Nice production, great content as always though 😊

    @Siliconpixel@Siliconpixel27 күн бұрын
    • Thanks. Did you know that you can slow down the video in KZhead? There's an option in the settings of the video.

      @SmartHomeJunkie@SmartHomeJunkie27 күн бұрын
  • great initiative. Please slow down a bit and please do not use dark mode, the code examples are hardly readable. Looking forward to the next episode.

    @GuusdeRuyter@GuusdeRuyter29 күн бұрын
    • Thanks. You can use the pause button or set playback to a slower speed. I will still use dark mode. Sorry. 🙃

      @SmartHomeJunkie@SmartHomeJunkie29 күн бұрын
  • Thx for the video. I am also having a hard time seeing the code. Could you maybe zoom in more?

    @scottwood646@scottwood64628 күн бұрын
    • On what device are you watching this? It should be very clear on a desktop PC. These tutorials are not meant to watch on mobile devices because you will create templates on a desktop PC anyway.

      @SmartHomeJunkie@SmartHomeJunkie27 күн бұрын
    • @@SmartHomeJunkie 70 inch screen in my living room mainly sitting 12 feet away. Looking at it in my office on my 32 inch monitor on my PC is not much better. For example, when you talked about adding comments, the text is not much different from the dark background. I have seen other videos where they zoom in a lot more on the text as they talk about it. That helps. to my eyes, the dark background is harder to see the text too. Thx again for the videos. I have watched you for a while now and enjoy your videos a lot.

      @scottwood646@scottwood64627 күн бұрын
  • Take it one step further and show the use in node red please.

    @mcfarlde@mcfarlde23 күн бұрын
    • Sorry, I don't do Node Red

      @SmartHomeJunkie@SmartHomeJunkie23 күн бұрын
  • YAML means 'YAML Ain't Markup Language'. It's a recursive acronym

    @rolandboni8057@rolandboni8057Ай бұрын
    • It depends on whom you ask 🤣

      @SmartHomeJunkie@SmartHomeJunkieАй бұрын
    • ​@@SmartHomeJunkieCheck the official yaml homepage

      @rolandboni8057@rolandboni8057Ай бұрын
    • @@SmartHomeJunkie The official homepage of yaml says something different

      @rolandboni8057@rolandboni8057Ай бұрын
    • @@rolandboni8057 I used this source, but don't take it too seriously: www.redhat.com/en/topics/automation/what-is-yaml#

      @SmartHomeJunkie@SmartHomeJunkieАй бұрын
    • @@SmartHomeJunkie neither do I 😎

      @rolandboni8057@rolandboni8057Ай бұрын
KZhead