YAML Basics // Level Up Your Home Assistant Skills
Тәжірибелік нұсқаулар және стиль
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
Пікірлер: 119
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!!
Excellent video. Thanks for the time and effort that went into making it. Thought I was already subscribed but I definitely am now.
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.
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
Ай бұрын
You are so welcome. I know those things tripped me up so other folks must encounter the same issues.
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.
Excellent video! Thank you. Very well explained.
learnt a lot as a new HA adopter...thanks for the great content
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
2 жыл бұрын
Excellent! I am so happy the video helped you on your automation journey!
Keep these videos coming! You earned my follow :)
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.
Great Explanation. Thanks
@ThisSmartHouse
Ай бұрын
You are welcome!
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
Жыл бұрын
Thank you for the kind words, it really means a lot! That was a fun podcast.
Excellent video, the best explanation I've seen so far.
@ThisSmartHouse
2 жыл бұрын
Happy to help!
Thank you so much, great help..
One of the BEST I've seen. Maybe the BEST. 👍👍
@ThisSmartHouse
2 жыл бұрын
Thank you! I need to plan more "professor" videos.
Absolutely well-organized structure. Thank you and I'm sure my subscription to your channel is not nearly enough.
Very helpful, thanks!
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
2 жыл бұрын
That is why I use an Eink tablet now to hand write notes, no more smudges. Thank you!!
Wonderful video, taught me a lot. Great presentation aswell!
@ThisSmartHouse
2 жыл бұрын
So happy it helped.
You're a gentleman and a scholar sir, your method of teaching is outstanding!
@ThisSmartHouse
2 жыл бұрын
Wow thank you! Who knew I could teach? What subject would you like me to do next?
very good breakdown! Very helpful! Thank You!
@ThisSmartHouse
2 жыл бұрын
Glad it helps!
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.
Thank you! Challenging topic, yet very helpful for a newbie like me.
@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.
this is awerome....! thank you....
Great Video thanks
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
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.
"We Olds". Love it! We ex-Telecomm Geeks might call it an "octothorpe".
Thanks... a really good explanation Absolutely well-organized structure.
@ThisSmartHouse
Жыл бұрын
I am so glad you found the video helpful!!
Great job, a follow video would be advantages and disadvantages of using yaml vs the ui
Thank you I found your tutorial very easy to understand and it was really helpful.
@ThisSmartHouse
Жыл бұрын
Glad it was helpful!
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.
Excellent video. Thank you. You have gained a subscriber.
@ThisSmartHouse
2 жыл бұрын
Awesome, thank you!
Thank you for this tutorial. I learned a lot.
@ThisSmartHouse
2 жыл бұрын
Glad it was helpful!
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
2 жыл бұрын
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
2 жыл бұрын
@@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
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.
Great video. Thanks.
@ThisSmartHouse
Жыл бұрын
You are welcome!
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
Жыл бұрын
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!
Thank you for this video. Keep going.
@ThisSmartHouse
2 жыл бұрын
Thank you, I will
Great run through, thanks :)
@ThisSmartHouse
2 жыл бұрын
No problem!
Thanks for this.
@ThisSmartHouse
2 жыл бұрын
You are welcome!
Hello It's wonderful, I disover many informations about yaml.. a french man
Great Work. Thanks a lot.
@ThisSmartHouse
2 жыл бұрын
Most welcome!
Love the Dr. Strangelove reference
@ThisSmartHouse
2 жыл бұрын
At least someone got it!
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?
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!
what a newbie friendly video. thx
@ThisSmartHouse
2 жыл бұрын
Glad it helped. This week's video will be another getting started video.
Thanks
Thanks man I was just about to give up on the whole thing.
@ThisSmartHouse
2 жыл бұрын
Awesome!
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)?
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?
Yaml comes in usual form, you also have varian called yaml script,there is also toml which is similar to yaml.
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
2 жыл бұрын
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
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
i didnt know that YAML is an acronyme de Yet Another Markup Language xD great video well explained
@ThisSmartHouse
Жыл бұрын
😂 I know. I liked that one. Thanks!
@joeking5211
5 ай бұрын
Yet Another Messup Language
Would it not have been easier to screen cap doing this on Notepad++? Good video and explanation.
@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.
Just "Thank You"
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
Жыл бұрын
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
Жыл бұрын
@@ThisSmartHouse Thanks! 🙏❤️
@ThisSmartHouse
Жыл бұрын
You are welcome!
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.
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
2 жыл бұрын
So both the shop and the house are on the same wifi network? What sort of lights are you using?
@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
2 жыл бұрын
I’m use ethernet hardwire I not have them setup on WiFi
please more of yaml
@ThisSmartHouse
2 жыл бұрын
What things are you specifically looking for?
19:42 - AHHHHHH!!!!
@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.
I have a feeling it was me sending the discord notifications🤣🤣🤣
@ThisSmartHouse
2 жыл бұрын
Pffftt.😂😆 I didn't realize I had the speakers turned on and I couldn't edit out the notification sound.
What is mqtt what is input_select etc
@ThisSmartHouse
Ай бұрын
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/
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
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
2 жыл бұрын
@@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.
Dr Strangelove
@ThisSmartHouse
Жыл бұрын
YEP!
thanks for the video. Please remove background musing for the next one
@ThisSmartHouse
2 жыл бұрын
Some people like it...
YAML - YAML Ain’t Markup Language
@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. 🤣
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.
@ThisSmartHouse
Жыл бұрын
What part are you tripped up on?
The only thing I learned is don’t use tabs
@ThisSmartHouse
2 жыл бұрын
Well if you learned that then that is enough... 😂
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
Ай бұрын
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.