Any AI that can help me out with creating good YAML?

,

Oof, seems like my project ended before it truly began, I might have to go through Arduino IDE instead.
Thanks for that valuable bit of information.

I think you’re misunderstanding what @walberjunior meant It’s not a limitation of ESPHome, but rather the device/sensor; it’s a reader only.

The Data Sheet does state writing capabilities.

This document describes the functionality and electrical specifications of the contactless reader/writer MFRC522

That’s a different component from the RC522 mentioned previously. Guessing it doesn’t have write capabilities while the MFRC522 does.

Strange, for Arduino there are examples of clone and read/write, but for Esphome I didn’t even find a request to implement the function

I don’t think so, on the Esphome page itself there is a link to the same datasheet as Royeiror posted

Or am I missing something

No idea, all I know is a simple Google search for RC522 shows a bunch of devices that only advertise reading capability whereas searching for MFRC522 yields devices advertising read/write capabilities. Never used any of them though.

The board I actually own has RFID-RC522 silkscreened on it and coincides with THIS data sheet, it seems like it might be that they don’t advertise writing capabilities while in fact it has them. I don’t really know, In any case my rotary encoder seems to bring the screen down, so I’m stuck there.

It does seem like I got a workable Arduino sketch out of ChatGPT if only the encoder didn’t turn the built in OLED screen off. Hardware issue, not software.

Claude is currently the best AI chat to help with yaml files. You need to pay for it though as the free use is very limited and it will take a while for you to learn how to ask properly.
I’ve created a GPT to help me but it just isn’t good enough yet, I’m using GPT 4o with canvas, the very latest version as I type. My GPT knows all about HA and various other related programs and you can always upload the latest docs to it to make sure it is completely up to date. It has two main problems, 1- it will randomly make stuff up which you didn’t ask it to and often miss out or remove stuff from your current yaml and not tell you it has done so. 2- it has an output limit, most yaml files are small enough for it to cope but many aren’t. A dashboard is a good example of when the yaml can get too large for it to cope.
On the plus side though, I usually show it my current yaml and ask it to make changes, you have to be very clear that you want it to ‘add’ new things and not to make any other changes, then be very clear that you want it to show you the full new yaml file, so you can copy n paste it. If you do that, and check the file over carefully, GPT will be right about 80% of the time, if you then continue the conversation with it and tell it the file isn’t quite right, there is a good chance you will get what you need. You always have to be very clear with it. It can be fun though, especially if you ask it to talk to you like a friend would, it will likely get very apologetic and tell you it hopes you’re not upset and promise to get it right next time. Also try asking it to talk to you like a favourite TV or film character.

Gemini, even the pro version is pretty poor with HA, it looks like it knows a thing or two, seems to understand and even suggest better ideas but it has big problems with longer files, it often won’t finish them and if you don’t notice, you can have real problems. Always double check the output, I sometimes copy n paste it’s output to another AI to check. It will get small files right the vast majority of the time though and if you upload the latest docs to it before asking your questions, you will get a fully up to date answer.
But, if you want very good AI assistance with HA, pay for Claude and learn how to use it.

Sounds harder than just learning YAML configuration in the first place — and that way, you get to understand what you’re running rather than allowing backdoors for the robot revolution.

Part of the enjoyment I and others get from contributing here is helping people learn. If you rock up with a bunch of robot vomit code that doesn’t work properly, and you neither understand the code nor want to, but just want to know which bits to change to make it work, I’m going to be much less inclined to help.

2 Likes

I was never able to create good yaml with ai. But there is a plus side. As ai give you explanations on things he is trying to do, it can help people to understand what should be done. Consulting documentation and some trial and errors can help in whatever someone is doing. But relying only on code that was generate by ai will give wrong to poor results.

That isn’t necessarily true by any means. I recently made an automation with the help of Claude to charge my Bluetti battery whenever the sun is shining via a ZigBee smart socket. I showed the AI the full specs of the Bluetti and it came up with the idea of only charging it, not only when the sun is shining but only when it actually needs charging. It knew the specs of my smart socket and added in a way to check if the battery pack actually needs charging, not only that, it also told me how it could charge it differently depending on how much it was already charged. These additions were completely Claude’s idea, I never even considered them or even thought of them as a possibility. It may, in fact be overkill, I may not ever use it that way but the resulting automation is much more complex than I could ever have thought of. I simply wanted to charge it when the sun is shining. I probably could have just about made that with some trial and error but this more complex version was made in mere seconds.
Learning to use an AI isn’t harder than “just learning YAML configuration in the first place” & “relying only on code that was generate by ai will give wrong to poor results.” may occasionally be true if you’re not careful but it’s easy enough to check the code within the HA visual editor.

When I am stuck and I can’t get any answers on here or anywhere else, I try Co-Pilot which is part of Microsoft Edge if you have a PC. It helps me understand what I did wrong by explaining the code.

Example of what I type, “what’s wrong with my code: ” and it spits back explanations. From there I then try and figure it out. I use it as a last resort however, as others have said, it’s not always correct.

I was just speaking about my experience with it. It was chatgpt. 4.0 version is better but this standard version is plain awful. I never used Claude but it is good to hear that there is some ai that actually can do something useful. It will write code no problem about that, but the problem is that that code will not work or it will not work as expected. Checking documentation and in the end do it yourself will give you better results. At least that was in my case.
Another problem with it is that it will give you a lot of info but many times that info is outdated or just plain wrong. And till you check everything out to see what the heck, maybe you could do it by yourself.

Another good use of AI chats, which I already alluded to is the fact you can give it new data. It is true that the AI chats have cut off dates and if you’re not aware of that, it could cause problems. You can always ask it what it’s current cut off dates is though.
Back to the point, you can give it new data-
Post the latest HA docs to it, either give it the URL or copy and paste any section of the docs you are curious about, then ask it questions. Once you’ve told it, so long as you stay in the same chat window, it knows everything about the current version or the post you posted, so you can then ask questions and get good answers, this is a good way to learn what you want to know about a particular subject instead of reading the entire document.
A good example is, if I wasn’t bone idle and decided I wanted to learn YAML, I could post the latest documentation for YAML on HA then instead of getting it to write the code for me, I could simply ask how to do it. So, I could say to it that I want to create an automation that will turn on my security camera whenever I leave the house, this is a simple task which I’m sure I could do without help but if I couldn’t I could simply ask it how I would go about it, this would go something like this:
I post the link to the latest HA docs, the latest YAML docs, then tell it about my setup, I could simply screenshot my add ons, integrations and my list of devices from states then ask my question,
" using the info I just showed you, tell me, step by step, how to create an automation to ( insert automation idea here) , I want to learn how to write YAML, so walk me through it from the point where I click “create automation” to the point I hit save. Please wait between steps for me to tell you I’ve done that part before showing me the next step. Tell me in the voice of Butcher from The boys TV show."
That last bit is just for fun but try it with your favourite character, it makes the learning more fun. ChatGPT Will give you a toned down version of Butcher by default, Claude will give you both barrels.
The prompt I used there will work exactly as you might expect, it will follow your rules to the best of it’s ability. This is a great way to learn any language, not just computer language either.
So, yes, ChatGPT and the like can give you poor results but you get what you ask for. Poor prompt, poor output, be specific, you get what you need, usually. They do make some bizarre mistakes sometimes, and I have got quite angry more than once, they don’t care though, they apologise for pissing you off then try to correct their mistake. Overall, they are a great tool, a tool that requires a little bit of learning but that’s part of the fun. I only actually do HA stuff for fun, something which some people find odd but it is more of a hobby for me, one that can prove useful.

Yes it did cross my mind to give it a link on documentation on several occasions. And i did. But only paid version can give you some useful results. Free version is disaster. But there are a lot of good examples of a code around the net wrote by people. I never got any code that is better written by ai than a human who knows its job. But that is just my experience with it.