I used Github AI to create a rule for time conversion. When the rule was run it did not work as intended but instead it created about 35 similar rules that now are locked and can’t be deleted through the UI. The openHAB is the latest version and running on a Raspberry Pi4. How can I enable deleting of them?
I assume your AI created .rules files. You need to delete them. They’re in a specific folder. See here: Rules | openHAB and search Google.
Remove the rule.
Restart OH.
That should clear out the rules.
What ever the AI generated, it’s very wrong. Please review the docs and compare what you find there to whatever this AI produced.
I managed to solve the problem without screwing up my openHAB setup. Here is what I did,
- Disabled all the locked rules
- Stopped openHAB
- Made a backup of the automation_rules_disabled.json file
- Opened the the automation_rules_disabled.json file in nano
- Removed the 35 locked rules definitions from the file and saved it
- Restarted openHAB
- Problem solved
I don’t exactly remember at what point of running the rule for the first time there was a warning saying " This feature is not supported by openHAB"
I help out on the Tasmota forum and dread ‘I used AI to create…’. AI may be very good for ‘straight’ JavaScript etc but doesn’t understand things like openHAB and Tasmota. I use AI every day but I ‘sense check’ it before implementing it. AI will never replace in depth knowledge. The original concept of AI was (and is) to assist and not replace
Although Claude has yet to make a wrong assumption about openHAB, truth be told. But the most important thing is to understand what it proposes, as opposed to blindly accepting and using it.
Indeed, Claude, ChatGPT and Gemini have become a lot better at creating OH rules. Sometimes they even produce correct rules. But their code is often much more complex than it needs to be. But I do see a day when they will be able to manage creating a decent working rule, but not yet. Maybe in six months though.
On this forum there are certainly members with different coding skills from beginners to professional coders. One might create project after project while someone else is making a occasional personal project.
Personally I am not a complete beginner in coding but I usually have one project and after it is finished there might be a while before something new comes up. When you do occasional coding you don’t gather any significant coding expertise you just have a basic understanding.
Before AI this meant that my coding included a lot of googling to find solutions for coding issues that took a lot of time. Now using AI IT is much faster to find relevant solutions.
I have been running a slightly modified version of Markus Sipiläs Spot_Price_Optimizer for our house heating and currently I am making page widgets for overwiev and setting of function parameters of the heating system.
I have been using different AI tools for the task, VS Code Github, Perplexity, Mistral Vibe and AI Studio. Here are my findings so far,
- VS Code Github is the easiest to work with and usually gives reasonably good code to widget page layout requests and rules
- Mistral Vibe gives clear explanations on how a piece of code you already have that helps to spot coding logic errors
- All of the tools seem to have the problem that in some situations when the code doesn’t work they get into a loop where they indefinately change the code between two non working versions
- It is advisable to change the code in small steps and save the intermediate results
- You have all the time to check if all the modifications that you asked for and the AI confirmed really are carried out.
- There are times when AI just can’t create a fully working code and you have to figure out the last steps yourself.
So to summarize the AI tools helps an occasional programmer like me to get working code with a reasonable effort and time.