YAML Basics // Level Up Your Home Assistant Skills

2024 ж. 28 Сәу.
66 956 Рет қаралды

Today we take an in-depth look into using YAML for Home Assistant. Now if you are a beginner and want to add some integrations to Home Assistant that require code, then this is the video for you. We take a look at how YAML works in Home Assistant, how to split up your configuration, and how to use a Secrets.yaml file.
Hopefully this video helps you on your Smart Home journey.
❓What future topics would you like me to cover??❓
▶ Buy Me A Beer 🍻: www.buymeacoffee.com/ThisSmar...
▶ Timestamps ⌚:
00:00 - Opening
01:08 - Part 1: Intro to YAML
05:48 - Part 2: Collections
08:14 - Part 3: Comments & Full Example
11:31 - Part 4: Final YAML Notes
14:11 - Part 5: Home Assistant Split Config
17:46 - Note on Duplicate Keys
19:29 - Part 6: Secrets.yaml
22:18 - Outro
▶ Links in Video 🔗:
(I use Rebrand.ly for my URL shortening)
Home Assistant Yaml Docs - tshouse.link/hayaml
Home Assistant Split Config - tshouse.link/hasplit
Home Assistant Split Advanced Topics - tshouse.link/hasplitadv
▶ Product Links:
(When available, we use affiliate links and may earn a commission!)
My Main Home Automation Gear (Kit.co): tshouse.link/homekit
My Z-Wave Home Automation Gear (Kit.co): tshouse.link/zwave
▶ Get a One-Month Trial of Great Music for Creators (I use this on my photography channel): tshouse.link/sound
▶ Website: thissmart.house
▶ Recommended Playlists:
Smart Home 101 (Basics): • How to Wire A Smart Sw...
Home Assistant Add-ons: • Severe Weather Alerts ...
Video Guides: • Help Keep Your Kids On...
Wyze Products: • Wyze Light Strips // S...
#smarthome #yaml #homeassistant #homeassistant101

Пікірлер
  • Very, very helpful in understanding the yaml syntax. I love how you don’t skip over important concepts like nested quotations, fixed width fonts, includes and secrets. I can’t thank you enough for your presentation sir.

    @munkeepilot@munkeepilot2 күн бұрын
    • You are so welcome. I know those things tripped me up so other folks must encounter the same issues.

      @ThisSmartHouse@ThisSmartHouse12 сағат бұрын
  • This is exactly wat makes your channel amazing. Instead of doing the same stuff over and over you cover topics which might not generate lots of views but it's something we all need. Thank you for the amazing work!!

    @rishabMehta7@rishabMehta72 жыл бұрын
  • Excellent video! Thank you. Very well explained.

    @iansoper3453@iansoper345323 күн бұрын
  • Just started watching your video, looking forward to learning more about YAML. I did chuckle at the whiteboard and left handed struggle. As a kid, I hated writing. The stupid left handers hook and smearing frustrated me to no end. My dad, also left handed, knew how much I hated writing because of that. Grew up, didn't go to college right away, 10 years later started college and came across the same thing with writing. I was talking to my dad again, and he said, "rotate your hand below." I was like, "why the hell did you not say that to me back when I was growing up?" I spent an hour at night, practicing. I even compared it to writing right handed, since I'm almost ambidextrous. After a week, I lost my left handers hook, no more smearing, and writing on whiteboards and chalkboards in college classes stopped being a problem. Now back to watching your video, and learning YAML. Nice thing about coding, keyboards don't care if you're left handed.

    @TheRiehlThing42@TheRiehlThing425 ай бұрын
  • Thank you for the awesome vid! I was HIGHLY CONFUSED before I got here and ALMOST gave up!. This is the first vid of yours that I have watched im really looking forward to the others!

    @ramiromaney3499@ramiromaney34992 жыл бұрын
    • Excellent! I am so happy the video helped you on your automation journey!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Very helpful, thanks!

    @ericfung3308@ericfung33084 ай бұрын
  • learnt a lot as a new HA adopter...thanks for the great content

    @andytaylor1@andytaylor12 жыл бұрын
  • Keep these videos coming! You earned my follow :)

    @MrMarco7ify@MrMarco7ify24 күн бұрын
  • Excellent video, the best explanation I've seen so far.

    @JoseBerruezo@JoseBerruezo2 жыл бұрын
    • Happy to help!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Love the Dr. Strangelove reference

    @My427Cobra@My427Cobra2 жыл бұрын
    • At least someone got it!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Wonderful video, taught me a lot. Great presentation aswell!

    @Larstronomy@Larstronomy2 жыл бұрын
    • So happy it helped.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Absolutely well-organized structure. Thank you and I'm sure my subscription to your channel is not nearly enough.

    @Silent1Majority@Silent1Majority2 жыл бұрын
  • Thank you! Challenging topic, yet very helpful for a newbie like me.

    @WPGinfo@WPGinfo Жыл бұрын
    • I know it took me well over a year to get comfortable with YAML. Hopefully this saves you some grief! So happy it was helpful.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • very good breakdown! Very helpful! Thank You!

    @designbybeck@designbybeck2 жыл бұрын
    • Glad it helps!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • One of the BEST I've seen. Maybe the BEST. 👍👍

    @rebe7800@rebe78002 жыл бұрын
    • Thank you! I need to plan more "professor" videos.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Absolutely fantastic tutorial. I have some programming experience with Java, and for the life of me I couldn't figure out why my tabs were all screwed up. Java is all about tabs, YAML is all about spaces.

    @JRWJWV@JRWJWV Жыл бұрын
  • "We Olds". Love it! We ex-Telecomm Geeks might call it an "octothorpe".

    @SBinVancouver@SBinVancouver2 жыл бұрын
  • Fantastic video. I discovered you via your appearance on the hass podcast. Well paced and confidence inspiring. I've been having a watch of some of your other videos too. Your subscriber count doesn't do your work justice. Keep it going.

    @JustinHughesRoberts@JustinHughesRoberts Жыл бұрын
    • Thank you for the kind words, it really means a lot! That was a fun podcast.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Thanks... a really good explanation Absolutely well-organized structure.

    @bexroot634@bexroot634 Жыл бұрын
    • I am so glad you found the video helpful!!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Thank you so much, great help..

    @fredman1956@fredman19562 жыл бұрын
  • Thank you for this tutorial. I learned a lot.

    @Lonestar101@Lonestar1012 жыл бұрын
    • Glad it was helpful!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Great Video thanks

    @dannytech4709@dannytech4709 Жыл бұрын
  • Thank you I found your tutorial very easy to understand and it was really helpful.

    @daryllvangeelen1249@daryllvangeelen1249 Жыл бұрын
    • Glad it was helpful!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • I finally found someone to explain how to code YAML, Thanks! The only question I have is: where do I find my YAML Config in HomeAssistsnt - this is a missing key for me. Also, I am have subscribed to your channel and look forward to more videos.

    @clarencemartin57@clarencemartin5711 күн бұрын
  • this is awerome....! thank you....

    @robakers6127@robakers6127 Жыл бұрын
  • Very good! Instead of theory, you showed an actual application of yaml. I have no knowledge of home assistant but I'm sure this will help with an sdwan project I have at work.

    @klittlet005@klittlet005 Жыл бұрын
  • Hey Ryan. Heard you today on the Home Assistant podcast, where you mentioned you live in KC. Cheers from Brookside! Thanks for this video, and also the HA setup video that helped me get started with HA earlier this year.

    @kevinbrown1757@kevinbrown1757 Жыл бұрын
    • I actually didn't know they posted the podcast until I saw your comment. 😅 I live out east but I work down on state line. I'm so glad the videos helped!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • You're a gentleman and a scholar sir, your method of teaching is outstanding!

    @WiseInetellect@WiseInetellect2 жыл бұрын
    • Wow thank you! Who knew I could teach? What subject would you like me to do next?

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Thank you for this video. Keep going.

    @estqwerty@estqwerty2 жыл бұрын
    • Thank you, I will

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Great video. Thanks.

    @fredaker8353@fredaker8353 Жыл бұрын
    • You are welcome!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Randomly found your channel and it is great information. My wife is left handed so I understand your pain of keeping your hand clean. Keep up the great work.

    @usmcboyd@usmcboyd2 жыл бұрын
    • That is why I use an Eink tablet now to hand write notes, no more smudges. Thank you!!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Excellent video. Thank you. You have gained a subscriber.

    @AntonioVillanuevaB@AntonioVillanuevaB2 жыл бұрын
    • Awesome, thank you!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Great Work. Thanks a lot.

    @ahmedishak7240@ahmedishak72402 жыл бұрын
    • Most welcome!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Great Video! Understanding YAML took me a longtime like 3 years when Home Assistant was on 0.40. If I had this video then it would have saved me a lot of headaches! I love the whiteboard approach! Thanks again

    @MarkGhali@MarkGhali2 жыл бұрын
    • The secret is, the whiteboard kept me from having to animate stuff in after effects. So I just took the lazy approach. 😅 I think I've been using yammal about as long as you have. I'm so happy that I have the tools now that we didn't have back then. Vs code makes all the difference..

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
    • @@ThisSmartHouse VS Code is such a huge help now!! I had to put home assistant down sometimes after completing breaking it back in the day. Now it is rock solid

      @MarkGhali@MarkGhali2 жыл бұрын
    • Oh man I know the feeling. There were a few times before I discovered backups that I completely hosed my system. Not a good day.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Great run through, thanks :)

    @DavidTurner-Tripmonkey@DavidTurner-Tripmonkey2 жыл бұрын
    • No problem!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Great job, a follow video would be advantages and disadvantages of using yaml vs the ui

    @scotttaylor6451@scotttaylor64512 жыл бұрын
  • Thanks for this.

    @xtremeideaz@xtremeideaz2 жыл бұрын
    • You are welcome!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • great info, thank you ! I have a problem. I have an esphome switch that turn on light based on sunset and sunrise. The problem is, if the hass automation run while switch is disconnected, the switch wont change state even after it is reconnected to hass. My idea is to add sunrise and sunset state check on script and call it every time the switch connect to hass in addition to existing automation. Is there on_connect event in esphome or somewhere else that can trigger script execution in hass?

    @jackfruit123@jackfruit1237 ай бұрын
  • Thanks... really good explanation of the fundamentals which I sorely needed. I'm a HA & YAML newbie, migrating from the Insteon environment and have found it challenging to find a cohesive "here is how you do it" guide. Generally I've found information to be scattered and generally of a "troubleshooting" nature, which is often helpful, but does not provide the same fundamental understanding.

    @timwhitlock2172@timwhitlock2172 Жыл бұрын
    • Awesome and welcome! I had insteon gear but dumped it 3 years ago. Sad to see then just close. But I heard some users are buying the company. What other topics are you struggling with? I am trying to make a whole getting started series.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Hello It's wonderful, I disover many informations about yaml.. a french man

    @jboissi@jboissi Жыл бұрын
  • what a newbie friendly video. thx

    @yingderekliao1981@yingderekliao1981 Жыл бұрын
    • Glad it helped. This week's video will be another getting started video.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • Good explanation of the basics of yaml. I searched for yaml tutorials but I think I'm a bit further than beginner. One correction: your example for the option is indeed a list, but the example for the sensor is a dictionary. Because it has a key and value, even when it has only one key and value.

    @mdbruin8143@mdbruin8143 Жыл бұрын
  • Loved the video. Thanks a lot. Just wanted to ask a question: is there a way to create a formula that you can send a value to and have it return the correct value? In this instance, for example I have power entities either being negative or positive, and since I have to return positive values I have written 7 or 8 if statements to get the correct value back, but it seems more intuitive to actually write something as a formula, plug in the entity and get back the desired result. Can this be done?

    @alexlay7809@alexlay7809 Жыл бұрын
  • Thanks man I was just about to give up on the whole thing.

    @Joseph-ko2kl@Joseph-ko2kl2 жыл бұрын
    • Awesome!

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Thanks

    @stevetrapp1095@stevetrapp10952 жыл бұрын
  • Just "Thank You"

    @peterengland6153@peterengland61538 ай бұрын
  • Thank you for taking time to make this instructional. For beginners like me, who are just starting out...what should I be learning first? I'm talking about the very first steps in programming. Any suggestions would be appreciated. Thank you

    @cyosh345@cyosh3452 жыл бұрын
    • You are so welcome. What specifically are you trying to accomplish? I usually suggest getting used to the YAML for configuration, then start building automations. You can swap back and forth between the GUI automation builder and YAML. It is nice, because the GUI will build stuff for you, then you can see what the underlying YAML is doing.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
    • @@ThisSmartHouse I'm specifically trying to understand programming language for Home Assistant. It seems basic to those who know, but I've been on the outside all this time...just now stepping into it. Thanks for your suggestion about yaml

      @cyosh345@cyosh3452 жыл бұрын
  • Briljant explanation. One question though, it seems that when you use include, the sequence is important? I'm stille trying to get my switchbot out of the configuration file, but it doesn't accept that. Keep up the great work, I really love your content!

    @DJH27673@DJH276732 жыл бұрын
  • Thanks for the video, I've just set up Home Assistant this week while I'm waiting for my new Zigbee thermostats to come so I'm giving myself a crash course. I think I'm going to have to find a better editor than nano 🤦 Could you explain why some sub sections require a hyphen when they're a list of items at the same level of the hierarchy (eg "-platform: mqtt") but not others (eg all of the items under "threat") I assume it's needed when the list of entries are all different versions of the same thing (if you get what I mean)?

    @WMartinNI@WMartinNI2 жыл бұрын
  • Yaml comes in usual form, you also have varian called yaml script,there is also toml which is similar to yaml.

    @raughboy188@raughboy18823 күн бұрын
  • i didnt know that YAML is an acronyme de Yet Another Markup Language xD great video well explained

    @Lunolux@Lunolux Жыл бұрын
    • 😂 I know. I liked that one. Thanks!

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
    • Yet Another Messup Language

      @joeking5211@joeking52113 ай бұрын
  • Would it not have been easier to screen cap doing this on Notepad++? Good video and explanation.

    @syotos8643@syotos86432 жыл бұрын
    • I did grab some screen caps out of vs code. But showing the spaces was more difficult that's why I decided to do the whiteboard instead.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Thanks for the excellent tutorial! I have a question: You created a secrets file (with the letter S at the end of the word) but in the main configuration file you wrote "!secret xiaomi ip" without the letter S at the end of the word secret. why?

    @ElishaiPoran@ElishaiPoran11 ай бұрын
    • That is the Home Assistant / YAML nomenclature. If you see the documentation here, that is how it is done: www.home-assistant.io/docs/configuration/secrets/ But you are right that is kind of strange. I guess you can think of it as the file holds all of the secrets, while when you call it you are referring to one secret.

      @ThisSmartHouse@ThisSmartHouse11 ай бұрын
    • @@ThisSmartHouse Thanks! 🙏❤️

      @ElishaiPoran@ElishaiPoran11 ай бұрын
    • You are welcome!

      @ThisSmartHouse@ThisSmartHouse11 ай бұрын
  • please more of yaml

    @RupertoCamarena@RupertoCamarena2 жыл бұрын
    • What things are you specifically looking for?

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • 19:42 - AHHHHHH!!!!

    @WanderlustWonderscape@WanderlustWonderscape Жыл бұрын
    • Yeah looks like my adjustment layer with the zoom slipped over the wrong clip. Unfortunately you can't edit an existing video except for to black out.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • I have a feeling it was me sending the discord notifications🤣🤣🤣

    @rishabMehta7@rishabMehta72 жыл бұрын
    • Pffftt.😂😆 I didn't realize I had the speakers turned on and I couldn't edit out the notification sound.

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • How to setup a secondary home assistant on the same net work. I have a shop that is 175 feet from my home that would like to be able to turn on and off the lights and setup some season in. I have tried remote-home assistant from gethub but keep getting errors. The master home assistant does not find the slave home assistant I thank that I’m not getting the yaml right.

    @hogwelder505@hogwelder505 Жыл бұрын
    • So both the shop and the house are on the same wifi network? What sort of lights are you using?

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
    • @@ThisSmartHouse I have z-wave wall switches and some Zigbee light bulbs, I also have some motion sensor that are z-wave. I use a iPad or iPhone for the controller with Smartthings. I would like to able to connect the Home Assistants together on one control panel like it is in Smartthings but went I try to install remote home assistants I get a error that says the sever can not be found. I have watched a couple of videos about how to connect multiple HAs but they are not on the same network.

      @hogwelder505@hogwelder505 Жыл бұрын
    • I’m use ethernet hardwire I not have them setup on WiFi

      @hogwelder505@hogwelder505 Жыл бұрын
  • This vid looked like the holy grail, but at 7:40 Totally lost, you got two platform:mqtt in the list, how does that work ???, thought they should be merged ???. Are you saying 'every' mqtt topic/payload has to have it all repeated ???. If it is a list, surely that's a duplicate, so not valid ??? I really am Bemused & confused here, any clarity here would be greatly appreciated or any other refs/vid you can point me to to clear this up ? . Kind Rgds.

    @joeking5211@joeking52113 ай бұрын
  • This is the first and only instance of someone describing the in and outs of YAML and believing me I have searched. What I find interesting, is the lack of using something like BASIC in Home Assistant as it is a pretty widely-used programming language. YAML is really hard to understand and the flow is not obvious. I could walk through BASIC and tell you what each line is doing not the case with YAML. So have avoided trying to use YAML due to it being so hard to incorporate with something like a Trealife SPST SW or Athom plug. Many have poo-pooed me, stating " I got it working" as if to say folks that can't get it working are stupid. Oh well maybe sometime soon a larger company will jump in and organize the evolving smart home. Can not wait to dump HA and use something simple so I don't have to spend my free time trying to figure out how to use a piece of SW I have had around for years.

    @MaxGoddur@MaxGoddur Жыл бұрын
    • Home Assistant is moving away from YAML for most MAJOR items. But YAML is an important "language". You have to remember that something like BASIC is a true programming language, where as YAML is a configuration language. It is common across the IT industry (similar to XML) for parsing external data and bringing it into another application. If you really hate YAML, you might want to check out Node-Red, which uses a graphical interface that is based on Javascript.

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
    • @@ThisSmartHouse thank you and understand what you are saying and wonder how many folks can hit the ground running using either ESPhome or Node-Red. Find both approaches archaic. Oh well, I tried to incorporate this system but sadly will be abandoning it, too complicated for folks with other things to do. Guess most folks are looking for a "Set it and forget it" approach or at least I am.

      @MaxGoddur@MaxGoddur Жыл бұрын
  • Dr Strangelove

    @mrpenguin61@mrpenguin6110 ай бұрын
    • YEP!

      @ThisSmartHouse@ThisSmartHouse10 ай бұрын
  • YAML - YAML Ain’t Markup Language

    @josephgagnon555@josephgagnon55511 ай бұрын
    • "Originally YAML was said to mean Yet Another Markup Language" -en.wikipedia.org/wiki/YAML But I did see that YAML.org has now changed it to YAML Ain't Markup Language. 🤣

      @ThisSmartHouse@ThisSmartHouse11 ай бұрын
  • The only thing I learned is don’t use tabs

    @arizonaniceguy376@arizonaniceguy3762 жыл бұрын
    • Well if you learned that then that is enough... 😂

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • An example isn't an example if you don't describe what it DOES. Your 'Full Example' could be totally made up for all any newbie would know.

    @chrisw1462@chrisw1462 Жыл бұрын
    • What part are you tripped up on?

      @ThisSmartHouse@ThisSmartHouse Жыл бұрын
  • thanks for the video. Please remove background musing for the next one

    @towkukus@towkukus2 жыл бұрын
    • Some people like it...

      @ThisSmartHouse@ThisSmartHouse2 жыл бұрын
  • Why dont you explain how to use all the stuff you are talking about in an example? Tell stuff like how to actually implement a change? How do I get to the yaml file? Where is the editor, do I need to run the editor on the computer running HA? You need to explain everything because we noobs dont know ANYTHING about coding!!

    @kaspernaess-schmidt6618@kaspernaess-schmidt66184 күн бұрын
    • I wish I could cover everything in one video. But then it would be hours long. Plus those things very from install to install. Do you have the SAMBA add on set up? If so you can access the files via Windows explorer and use and file editor like notepad++ or VSCode. Or you can use the VSCode server add on and edit the files in the web browser. Let me know where you are stuck.

      @ThisSmartHouse@ThisSmartHouse4 күн бұрын
KZhead