YAML & Jinja course Episode 3: Conditionals & Loops (w/Examples)

Published 2024-05-05
Here's episode three of this YAML and Jinja programming course! I am explaining everything about If-Then statements and For-loops. This video covers everything you need to know to get started with If-Then statements and For Loops in 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:
* For loop variables: jinja.palletsprojects.com/en/3.1.x/templates/#for
* The YAML and Jinja Course Playlist:    • YAML & JINJA Templating Course  

Blog version: www.smarthomejunkie.net/yaml-jinja-templating-cour…

⭐⭐⭐
* Join this channel to get access to perks: 📺 youtube.com/c/smarthomejunkie/join
* Please consider becoming my patron 🏅 at www.patreon.com/join/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/review-and-advertisement-i…

My Devices: github.com/smarthomejunkie/MyDevices

Instagram: www.instagram.com/smarthomejunkie/
X: www.x.com/smarth0mejunkie
Mastodon: mastodon.world/@smarthomejunkie
Facebook: www.facebook.com/smarthomejunkie/
TikTok: www.tiktok.com/@smarthomejunkie
Discord: discord.gg/at8v5hW

Music by:
* 2TECH-AUDIO: 2tech-audio.bandcamp.com/

00:00:00 Introduction
00:00:51 If-Then Statements
00:05:37 For-Loops

#homeassistant #jinja #yaml #templates #templating #programming #ifthen #forloop #forloops #tutorial

All Comments (21)
  • @SmartHomeJunkie
    Hey! Let me know what you think of this episode of the YAML and Jinja course! I'm curious!
  • @major_west
    I replayed the first two episodes and started taking notes so I can refresh my memory the next time I'm writing a template. Can't stress enough how useful these courses have been! 💚
  • @R2Sweden
    Thank you, amazingly good! Also; your set up is fantastic with the division into sections and all the information below with references etc. You lead me on the right track right from the start and I can test things in peace afterwards. My stress factor has also leveled off to a comfortable level when I listen. Thanks again for your commitment!!
  • @daveforrester61
    Another excellent tutorial. I think this one is finally allowing me to understand and use For Loops!
  • @edwaaij4752
    Thanks Ed. Another step further. I'm already looking forward to the next video.
  • Excellent video Ed. I wish such a video existed 2 years ago, when I had to figure out all this. Even with basic knowledge of if-then-else and for-next statements, you still need to know how it works in ninja2 templating.Thanks.
  • @My-noname
    Tnx! Good video. As an old sh script ninja, this feels right at home.
  • @Fadukes
    Very useful programming examples for newbies
  • @shiPham0705
    thank you for your service. help me a lot to setup my HA for 2 weeks ago !
  • @mikaellume4657
    Hey, I am looking every day for the next course, I hope you are going to follow-up your series as your tutorials are greatly done. A pleasure to watch :washhands:
  • @david18xx33
    The pace of this video was much better. I did not have to stop it and rewind to make sure I got it. The 1st two videos I had to do that a lot.
  • @sevagjb
    Thank you, Ed. I learned new tricks today The loop is incredibly powerful.
  • @R2Sweden
    Thank you Ed, exelent tutorial!
  • 🤣🤣 I love that you addressed the comment about speaking too fast. Your videos are awesome! I understand the comment, but I just use CC and rewind from time to time. But I did try the speed playback you suggested at .75, but then it sounds like you are drugged 🤣🤣. Also I love the transparency of your bloopers trying to pronounce words in English. I applaud you for doing these tutorials in English as a second language. Keep up the awesome work and look for some Kofi.
  • @halko1
    Thanks for the tutorial. I’m now going to check the previous episodes.