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