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

,

Hello everyone, I’m fairly new to this whole Home Assistant and ESPhome, and my coding skills are utter garbage, so I gave ChatGPT a try along with other LLMs and GPT-4 felt like it gave the best results, but at the end I ran out my queries and have to wait to try again, I’m still getting stuck while verifying the YAML for various reasons. And If I keep querying GPT-3.5 it seems like it just throws stuff at the wall to see what sticks. If you’re curious to see how it went, you can check the chat.

In any case, does anyone have a better tool? Keeping in mind I’m a complete noob. It seems like it’s almost there.

There’s a reason why the following is included in the Community Guidelines.

Both HA and ESPHome update frequently and have huge bodies of configuration examples available online that either never worked or no longer work… the odds massively disfavor an LLM getting anything but the most basic configuration correct.

3 Likes

I’m not a programmer and I’ve been using chatgpt a lot.
What I usually do is take baby steps and test before asking for any changes.

First get your NFC/RFID reader working.
Then get your display working.
Then you add the rest.

Sometimes chatgpt will change something in the code that you didn’t ask for, so asking chatgpt to change your Wifi network is somewhat unnecessary and can cause errors in a code that was previously working, you can do this later.

If he can’t fix an error, sometimes it’s better to open another chat and enter the latest code that works and change the way you asked him to change the code.

Do research when the code doesn’t work, it often creates things that don’t exist. So whether you like it or not, you will need to understand at least a little of what it is generating.

1 Like

That sounds like a lot more work than just reading the documentation.

4 Likes

This forum is far better at helping than AI

4 Likes

The community is generally negative / unsupportive of using Chatgpt, for good reasons.

It’s not a great tool for beginners as it misleads too often. Most begginers should just read and follow the docs and look at similar examples.

That said, I use it regularly. I find it very useful as an aid to a number of tasks, including extending repetative code blocks (where other methods aren’t appropriate), and helping with lambda’s (although it can wander off a fair bit).

And whatever you do, do not use it to help others on the forum:

1 Like

For esphome I agree, but what about when it is a javascript to use on node red? I’m not a programmer so reading the documentation doesn’t always help.

I don’t drink the Node Red Cool-Aid.

And that’s also, why you should not expect getting it right with AI. Because as not programmer, you are not able to correct the code, if AI got it wrong. You simply won’t see the fault.

So, instead of trying to outsource your tasks to untrusted third party (AI), and getting mad afterwards, spend some time learning it yourself. The benefits of that are really great. If something does not work right, you know, where to look at…

4 years ago I did not know anything about linux, yaml and such, and now I’m able to manage a huge HA instance. I’ve learned that, and so can you… :wink:

2 Likes

@tom_l
:rofl:

It’s just an example, chatgpt is also very good with lambdas in esphome. I can do some things, but generally the code generated by chatgpt is much better than my IFs else’s.

@BebeMischa

I try to read a lot, but a lot of programming stuff just doesn’t enter my head.

I managed to do a lot using Arduino IDE and Javascript on Node Red before chatgpt, my first flow on Node Red is very complex and it must have taken a month to finish it, but with Chatgpt it is more efficient.

How is writing code you don’t understand efficient?

What happens when something goes wrong?

If it works without my IFs and else’s, that’s a good way.

Jokes aside, in many codes I would use IFs and else’s, and chatgpt made me a function.
I did a lot of things before chatgpt, so I learned something here and there. But I can’t do a function for example.

If it doesn’t work, look for the error and start again.

I know you don’t approve, like many here, but if I post something made by chatgpt it’s because I tested it before posting. Here is an example:

Personally I feel that tested code should be an exception to the rule and is “ok” (or at least “tolerated”)… But not my rules. And I know a lot of experienced members probably disagree.

I do agree, nothing better than people who know what they’re doing pointing a noob toward the answer, but I feel like it may seem like I’m asking for too much if posting a wall of text and a subject along the lines of “Fix my YAML”

For me the problem is posting without testing, thinking that this will help someone, even if it is with good intentions.
If it works, what difference does it make who wrote the code?

English is not my first language, so I want to warn you that what I’m going to say is not intended to offend anyone here. And I have no idea how many times a post from you, Taras or countless other members has helped me.

But if you think about it, you guys are kind of a chatgpt in human form. Many people don’t understand the code you posted to help with a question.

I’d much rather fix something that a human brain has tried to put together than the hallucinated ramblings of a robot whose inner workings we no longer understand trained off out-of-date and non-working code.

2 Likes

I may have unintentionally kicked the hornets nest with my question, which by no means do I want it to turn into a nasty flame war or a discussion about the merits of human vs AI coding.

The thing is, I’m very pumped with many of the capabilities the ESP microcontrollers and myriad of sensors available. Sometimes I find a Github with exactly what I need, but mostly it is out of date or it is not exactly what I need. I’ve been trying to code for over 25 years, and I’m still unable to get the whole syntax and such through my thick skull. I understand programming in natural language, meaning the idea or the operation behind it, but I just can’t write “Hello World” in any language other than Plain Text.

I had been hearing that AI could help out with coding or even substitute coders, but I’ve just recently found out, as most of you knew long ago, that’s just not the case.

I’d kill for a chatbot that does ESPhome with all the updates and such.

1 Like

I am not sure how this became a node red forum.

You’re right.

@royeiror
Don’t let this undermine your project, the esphome page is full of examples and there is always someone willing to help.

Looking at the esphome page, the rc522 doesn’t seem to write to the tags.