YAML Basics // Level Up Your Home Assistant Skills

Поділитися
Вставка
  • Опубліковано 11 лип 2024
  • 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
  • Навчання та стиль

КОМЕНТАРІ • 120

  • @rishabMehta7
    @rishabMehta7 2 роки тому +14

    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!!

  • @holohane
    @holohane 2 місяці тому +1

    Excellent video. Thanks for the time and effort that went into making it. Thought I was already subscribed but I definitely am now.

  • @MrMarco7ify
    @MrMarco7ify 3 місяці тому

    Keep these videos coming! You earned my follow :)

  • @JoseBerruezo
    @JoseBerruezo 2 роки тому +2

    Excellent video, the best explanation I've seen so far.

  • @rebe7800
    @rebe7800 2 роки тому +1

    One of the BEST I've seen. Maybe the BEST. 👍👍

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      Thank you! I need to plan more "professor" videos.

  • @ramiromaney3499
    @ramiromaney3499 2 роки тому +2

    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!

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому +1

      Excellent! I am so happy the video helped you on your automation journey!

  • @iansoper3453
    @iansoper3453 3 місяці тому

    Excellent video! Thank you. Very well explained.

  • @andytaylor1
    @andytaylor1 2 роки тому +1

    learnt a lot as a new HA adopter...thanks for the great content

  • @Silent1Majority
    @Silent1Majority 2 роки тому

    Absolutely well-organized structure. Thank you and I'm sure my subscription to your channel is not nearly enough.

  • @Larstronomy
    @Larstronomy 2 роки тому +2

    Wonderful video, taught me a lot. Great presentation aswell!

  • @JRWJWV
    @JRWJWV Рік тому +1

    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.

  • @JustinHughesRoberts
    @JustinHughesRoberts Рік тому +1

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому

      Thank you for the kind words, it really means a lot! That was a fun podcast.

  • @fredman1956
    @fredman1956 2 роки тому +1

    Thank you so much, great help..

  • @WiseInetellect
    @WiseInetellect 2 роки тому

    You're a gentleman and a scholar sir, your method of teaching is outstanding!

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      Wow thank you! Who knew I could teach? What subject would you like me to do next?

  • @TheRiehlThing42
    @TheRiehlThing42 7 місяців тому +1

    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.

  • @designbybeck
    @designbybeck 2 роки тому +1

    very good breakdown! Very helpful! Thank You!

  • @WPGinfo
    @WPGinfo Рік тому +1

    Thank you! Challenging topic, yet very helpful for a newbie like me.

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому

      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.

  • @ericfung3308
    @ericfung3308 6 місяців тому

    Very helpful, thanks!

  • @usmcboyd
    @usmcboyd 2 роки тому +1

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      That is why I use an Eink tablet now to hand write notes, no more smudges. Thank you!!

  • @munkeepilot
    @munkeepilot 2 місяці тому +1

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  2 місяці тому

      You are so welcome. I know those things tripped me up so other folks must encounter the same issues.

  • @klittlet005
    @klittlet005 Рік тому +2

    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.

  • @bexroot634
    @bexroot634 Рік тому +1

    Thanks... a really good explanation Absolutely well-organized structure.

  • @robakers6127
    @robakers6127 Рік тому

    this is awerome....! thank you....

  • @dannytech4709
    @dannytech4709 2 роки тому +1

    Great Video thanks

  • @AntonioVillanuevaB
    @AntonioVillanuevaB 2 роки тому +1

    Excellent video. Thank you. You have gained a subscriber.

  • @SBinVancouver
    @SBinVancouver 2 роки тому +1

    "We Olds". Love it! We ex-Telecomm Geeks might call it an "octothorpe".

  • @estqwerty
    @estqwerty 2 роки тому +1

    Thank you for this video. Keep going.

  • @rupam.mandal
    @rupam.mandal Місяць тому +1

    Great Explanation. Thanks

  • @ahmedishak7240
    @ahmedishak7240 2 роки тому +1

    Great Work. Thanks a lot.

  • @fredaker8353
    @fredaker8353 Рік тому +1

    Great video. Thanks.

  • @daryllvangeelen1249
    @daryllvangeelen1249 2 роки тому +1

    Thank you I found your tutorial very easy to understand and it was really helpful.

  • @DavidTurner-Tripmonkey
    @DavidTurner-Tripmonkey 2 роки тому +1

    Great run through, thanks :)

  • @Lonestar101
    @Lonestar101 2 роки тому +1

    Thank you for this tutorial. I learned a lot.

  • @xtremeideaz
    @xtremeideaz 2 роки тому +1

    Thanks for this.

  • @MarkGhali
    @MarkGhali 2 роки тому +1

    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

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому +1

      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..

    • @MarkGhali
      @MarkGhali 2 роки тому +1

      @@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

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      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.

  • @timwhitlock2172
    @timwhitlock2172 2 роки тому +2

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      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.

  • @yingderekliao1981
    @yingderekliao1981 2 роки тому +1

    what a newbie friendly video. thx

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      Glad it helped. This week's video will be another getting started video.

  • @kevinbrown1757
    @kevinbrown1757 Рік тому

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому

      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!

  • @jboissi
    @jboissi Рік тому +1

    Hello
    It's wonderful, I disover many informations about yaml..
    a french man

  • @My427Cobra
    @My427Cobra 2 роки тому +3

    Love the Dr. Strangelove reference

  • @scotttaylor6451
    @scotttaylor6451 2 роки тому

    Great job, a follow video would be advantages and disadvantages of using yaml vs the ui

  • @Joseph-ko2kl
    @Joseph-ko2kl 2 роки тому +1

    Thanks man I was just about to give up on the whole thing.

  • @clarencemartin57
    @clarencemartin57 2 місяці тому

    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.

  • @mdbruin8143
    @mdbruin8143 Рік тому

    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.

  • @stevetrapp1095
    @stevetrapp1095 2 роки тому

    Thanks

  • @alexlay7809
    @alexlay7809 Рік тому

    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?

  • @cyosh345
    @cyosh345 2 роки тому +2

    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

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому +1

      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.

    • @cyosh345
      @cyosh345 2 роки тому

      @@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

  • @Lunolux
    @Lunolux Рік тому +1

    i didnt know that YAML is an acronyme de Yet Another Markup Language xD
    great video well explained

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому +1

      😂 I know. I liked that one. Thanks!

    • @joeking5211
      @joeking5211 6 місяців тому

      Yet Another Messup Language

  • @DJH27673
    @DJH27673 2 роки тому

    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!

  • @peterengland6153
    @peterengland6153 11 місяців тому

    Just "Thank You"

  • @jackfruit123
    @jackfruit123 9 місяців тому

    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?

  • @WMartinNI
    @WMartinNI 2 роки тому

    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)?

  • @raughboy188
    @raughboy188 3 місяці тому

    Yaml comes in usual form, you also have varian called yaml script,there is also toml which is similar to yaml.

  • @syotos8643
    @syotos8643 2 роки тому

    Would it not have been easier to screen cap doing this on Notepad++? Good video and explanation.

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      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.

  • @WanderlustWonderscape
    @WanderlustWonderscape Рік тому

    19:42 - AHHHHHH!!!!

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому

      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.

  • @RupertoCamarena
    @RupertoCamarena 2 роки тому

    please more of yaml

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      What things are you specifically looking for?

  • @ElishaiPoran
    @ElishaiPoran Рік тому

    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?

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому +1

      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.

    • @ElishaiPoran
      @ElishaiPoran Рік тому +1

      @@ThisSmartHouse
      Thanks! 🙏❤️

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому +1

      You are welcome!

  • @rishabMehta7
    @rishabMehta7 2 роки тому +1

    I have a feeling it was me sending the discord notifications🤣🤣🤣

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      Pffftt.😂😆 I didn't realize I had the speakers turned on and I couldn't edit out the notification sound.

  • @hogwelder505
    @hogwelder505 2 роки тому

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      So both the shop and the house are on the same wifi network? What sort of lights are you using?

    • @hogwelder505
      @hogwelder505 2 роки тому

      @@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 2 роки тому

      I’m use ethernet hardwire I not have them setup on WiFi

  • @MaxGoddur
    @MaxGoddur 2 роки тому

    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.

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      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.

    • @MaxGoddur
      @MaxGoddur 2 роки тому +1

      @@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.

  • @joeking5211
    @joeking5211 6 місяців тому

    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.

  • @droneforfun5384
    @droneforfun5384 Місяць тому

    What is mqtt what is input_select etc

    • @ThisSmartHouse
      @ThisSmartHouse  Місяць тому +1

      MQTT is a common data exchange protocol used in smart home products (www.home-assistant.io/integrations/mqtt/)
      input_select is a building block in Home Assistant. Think of it as a drop down selection box. www.home-assistant.io/integrations/input_select/

  • @mrpenguin61
    @mrpenguin61 Рік тому

    Dr Strangelove

  • @towkukus
    @towkukus 2 роки тому +1

    thanks for the video. Please remove background musing for the next one

  • @josephgagnon555
    @josephgagnon555 Рік тому

    YAML - YAML Ain’t Markup Language

    • @ThisSmartHouse
      @ThisSmartHouse  Рік тому

      "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. 🤣

  • @chrisw1462
    @chrisw1462 Рік тому

    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.

  • @arizonaniceguy376
    @arizonaniceguy376 2 роки тому

    The only thing I learned is don’t use tabs

    • @ThisSmartHouse
      @ThisSmartHouse  2 роки тому

      Well if you learned that then that is enough... 😂

  • @kaspernaess-schmidt6618
    @kaspernaess-schmidt6618 2 місяці тому

    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!!

    • @ThisSmartHouse
      @ThisSmartHouse  2 місяці тому

      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.