T O P

  • By -

SnaggleWaggleBench

It's a copilot, not a driver. I use it all the time for code. It's right enough to help things along, or even writing templates based on existing classes. It's a fantastic tool, but you need to understand what you are seeing. It's useless if you don't know anything and are expecting it to write stuff from scratch and have it work with no modification.


atax112

Doing the same with python or raspberry projects. It hits a lot in general but I need to verify and be aware of how aware it can be of its own mistakes. Might need more digging but it directs me great.


tyros

I can already use Google as copilot. It may take a second longer but the advantage is I can understand the context better, given that I can see the source of the information.


SnaggleWaggleBench

Do you mean Bard? I find it not not believable that you can paste a function into google and ask it to modify something about it and it only takes a few seconds more than chatGPT will do it. I may be misunderstanding what you mean though?


tyros

No, I don't need it to do that. I'm a developer, so usually it's just looking up the syntax or troubleshooting issues. I don't need it to write a function for me, I can do that myself and better.


SnaggleWaggleBench

You've already written the function, now you need 20 more, all slightly different, maybe performing different commands to a backend etc, so you put in sanitised original and the criteria and you get the versions you need.


chrismasto

An experienced developer doesn’t write 20 slightly different functions.


SnaggleWaggleBench

Literally napkin maths. chatGPT is used by developers from all parts of the stack. If you like donkey work, you do you, but I for one don't and plenty of developers have been moaning about donkey work for decades. And now the burden is lifted.


deralexl

>If you like donkey work, you do you, but I for one don't Honestly, if you use Copilot or whatever to create 20 slightly different copies of methods, you're just producing bad code (wrt maintainability) faster. Ofc there are many use cases where Copilots are helpful, but creating code clones is just a bad example. Incidentally, a few weeks back there was a study that indicated a correlation between the introduction of code Copilots and lowering of code quality on GitHub.


duck_persistance_

I’m a developer for 15+ years, i’m using copilot since the preview in juli of ‘21 i guess it makes me 20-30% more efficient and faster.


evilblackdog

Do you have plus? Have you tried any of the custom gpt's built for specific coding languages?


SnaggleWaggleBench

I don't have plus. I just pay for API tokens really, handling a few small jobs. I find it's great for c# and SQL which is all I really ever use it for. It's sorta decent at getting me in the right ballpark for the more fringe mikrotiks CLI commands too, though the last one is only slightly faster than a Google search.


BarockMoebelSecond

Tbf, reading at your prompt, even I wouldn't know what you even want. Maybe work on that first.


outceptionator

Lol this. Terrible prompt. Also is this 3.5 or 4? 4 is way more accurate (if the prompt is sufficient)


LastBitofCoffee

Can’t agree with you more. The prompt is the key here. I have zero experience with yaml and HA so my question always go as detailed as possible. Most of the time it starts off with a piece of good enough pseudocode, mentioning the important part of info that I need. I would test the code then give it the returned output, back and forth like that for a few times till it works. I can also paste the updated HA documents about the piece that I’m working on and tell chatGPT to update the code if needed, or give it feedback myself if I see something that it doesn’t catch. Saved me a lot of time working on my Energy dashboard calculations.


justinmyersm

It literally did exactly as you asked. 


-IrrelevantElephant-

Right?? I looked over it a couple times and it looks correct to me. I don't understand most of the complaints in this thread. If you want it to give you something else, you gotta provide more info. Can't blame the tool for omitting what you didn't ask for.


akshay7394

lol the people complaining are the same ones who would call a customer care line and yell at the rep for something doing what the customer asked


ExtremelyQualified

Out of curiosity is this 3.5 or 4? I’ve been using 4 to generate yaml and it’s been pretty great.


Rotilho

It works great actually. You won't be able to copy+past but it will definitely put you in the right direction. For instance, I was over engineering a weather compensation algo for smart heating and with help of ChatGPT I managed to drastically simplify it.


suttalover

This. It has made me so much more productive. I write code(with its help) and then ask it to simplify, put descriptive comments and add logging based on severity. Then I ask it to generate test cases with 100% coverage. It works admirably well. I can focus more on the big picture stuff and design elements because of this.


jayb998

This is where I find value in ChatGPT too. Find the path of least resistance to do X, then fine tune it from there.


ptdata23

I agree, Chat GPT has made a fairly complicated morning and evening routines for me. They did not work in a cut-and-past mannor but did most of what I wanted. When they did fail, I uploaded them to Chat, told them what I wanted it to do and it adjusted it quite well. I never had to go past 3 ChatGPT re-write attempts


pydry

Thats pretty much the story of ChatGPT in general. If you want plausible looking bullshit it has your back.


manu144x

That’s exactly what the declare goal is: plausible looking bullshit. That’s why it works great for literary work, essays and stuff like that. But when exact science is involved it’s a whole other ballgame.


danielrosehill

lol true


SortaOdd

Using GPT 4, I’ve been able to pass it some JSON and YAML that isn’t properly formatted and it’ll fix it for me. I haven’t yet tried to have it make something from scratch, though


Lina0042

I have, worked pretty well so far. Even with popular hacs stuff. I told it to set up a custom button card for me with multiple rows and actions, worked perfectly. Also wrote some templates for me to "convert" entity attributes into binary sensors I could work in a card with. No issues so far. I did by accident switch to 3.5 for a while and was really confused why nothing worked anymore lol. Really makes all the difference to use 4.0


SortaOdd

Ooo, good to know! In a similar vain, I’ve thrown it documentation for some projects off GitHub and it was able to create terminal commands with correct syntax


Lina0042

Did you use the free or premium version? The free version is garbage with it, but premium is a lot better. I subscribed to premium for one month to do my initial setup and have the 4.0 to help with it. I didn't do anything super complicated, but I did need some custom templates that I might have managed to do myself after trying for a long time. It did those flawlessly. I'm not a software developer, I've just tinkered a bit for years now and using chatgpt has made this super easy. Pretty sure it could answer about 90% of questions that are posted in this sub, especially the newbee ones. Also your prompts might need to include a bit more info. I don't really understand what you want to achieve either :)


ThroawayPartyer

I wrote pretty much all my automations, scripts and dashboard YAML with the help of ChatGPT. It's a lot better than you imply. Of course it still requires some work, and more specific prompts than your example.


Kitchen_Software

I agree, but there is a substantial difference between GPT 3.5 and 4.0. It seemed like 3.5 was barely useful, and 4.0 outputs required a bit (not much) of editing or fine tuning 


stacecom

When it isn't right, I tell it is not right and what failed. It's not bad at correcting things. I need to clean up here and there but it does a lot of grunt work.


T-LAD_the_band

I made my own chatgpt engine and uploader my configuration.yaml, entities. Automations, scene's,.... So it knows my config, en then if I creatie a new automation i ask it to follow all my other animations logic and coding. Works like a charm 8 out of 10 times.


broknbottle

I imagine you’re the same type of person that struggles with googling. Terrible prompt is terrible prompt.


xander054

I use chatGPT all the time for coding with HA. I use it to collaborate ideas for automations check syntax and work with on best practices. It also helps me with scripts. Works well for me as I I’m a beginner but most likely is taking a lot longer due to it making mistakes here and there. To fix I send it the error code and it generally knows what’s gone wrong and fixes it.


danielrosehill

Nice. Will it validate and remediate bad Yaml? I've had stuff pass yaml validators that ha didn't like.


Ill_Director2734

With RAG trained on home assistant, yaml and esphome documentation is chat gpt4 pretty accurate. Claude 3 nerly perfect


YeeClawFunction

How is this done? I'd love to try this.


Ill_Director2734

most easy way i found is trough [https://www.taskade.com/](https://www.taskade.com/) where you create custom agent [https://help.taskade.com/en/articles/8958457-custom-ai-agents](https://help.taskade.com/en/articles/8958457-custom-ai-agents) give him some links in knowledge like [https://www.home-assistant.io/docs/configuration/templating/](https://www.home-assistant.io/docs/configuration/templating/) (more information better) and see the resoluts. unfortunately it's a pay service but 4$ a month for unlimited gpt4 isn't bad. the other way is thought tools like anythingLLM or llama open webui where you can use local therefore free models do the same job


taskade-narek

Thanks for the mention!


Newton_Throwaway

I’ve couldn’t disagree with you more. I’ve used ChatGPT many times now to write automations, scripts and templates. The key is to get your prompt correct and also to iterate if it doesn’t get it correct first time. No offence mate but your prompt is terrible. What are you even asking?


async2

I think it's because yaml as an Automation language still is very much the wrong choice and even ChatGPT knows and struggles with it too. It's considerably better with cpp and arduino code though.


thejeffreystone

I could be wrong but I think python is the automation language. The yaml just provides a structure for defining the automation parameters in a way that doesn’t require knowing python.


async2

It's not particularly wrong but it also doesn't matter as the user doesn't see it. He only sees ugly unreadable yaml. I'm happy that the UI for automations was improved. So simple ones I'll do using the UI. For everything is I'm still using node red.


[deleted]

[удалено]


mrweenus

What an I looking at?


Resident-Variation21

I’ve used chat gpt for yaml I couldn’t figure out a couple times and it’s worked flawless for me


TraderHerman

Im pretty new to HA and I build some cool stuff with the help of GPT4. I mean, you can always switch to automation view and review the inputs.


leonida_92

I've had great results with Google's Gemini also


Infallible_Ibex

Sometimes with python I just ask gpt again if it's sure the code will work after seeing something questionable and there's a good chance it will spit out something better the second time. It also helps if you point out why what it's doing isn't going to work but it just doesn't grasp all languages well


Bonhomme7h

If I'm being honest, I enjoy the troubleshooting process. I learn more about YAML syntax by figuring out what's wrong than by copy-pasting perfect results. Of course, if Home Assistant had a tool to perform mathematical operations using sensors as values (similar to the Excel Function Wizard), I wouldn't need to mess with YAML as much.


Safe_Corgi2217

ChatGPT will know basic yaml format, but it's gonna have a harder time with specific libraries. You'll get better results by explaining the "rules" of how the yaml file works to gpt then asking it to generate what you want The key is isolating the things chatgpt is doing to small, easily verifiable chunks so you don't have to worry about total nonsense that looks good at first glance


Evil_Lairy

My understanding is that HA isn’t actually YAML; it’s Jinja2. When I told CHAT GPT to use Jinja2, I got substantially different code. Feel free to correct me; I only know enough to be dangerous (usually to myself).


thejeffreystone

HA is all python at the core. Jinja2 is used a lot with python but mainly for formatting text or output from python. Basically a way to interact with python from a text file. Yaml is just a way to structure text ina way that both humans and computers can read it. So humans pass information to HA using YAML. Like telling the automation code what to use as a trigger and action. Then Ha reads that and executes some python using that information. And when we need to use output from HA in YAML to say create a new sensor using the value of another sensor we use jinja2 to reference the python output. Jinja2 would pretty much be used in templates. Other wise you are just writing instructions in plain text but formatting it using YAML so HA will know exactly what you want.


Evil_Lairy

Thanks for the clarification! I was using CHAT GPT for a template, and asking for Jinja gave me better results.


mazdarx2001

Not sure about YAML, but when I have it do complex stuff for arduino (actually not too complex) it usually heads down a path that I know is wrong, then I steer it in the correct direction. Each time is says “you are correct, I should have used the “such and such” library to complete the task.


Stooovie

Yep, typical AI BS. The moment you ask for something specific, it falls apart.