ChatGPT Binding Backport [5.2.0.0;5.3.0.0)

The openHAB ChatGPT Binding allows openHAB to communicate with any OpenAI API-compatible service, e.g., OpenAI, OpenRouter, Mistral AI, Ollama, etc. and access large language models like OpenAI’s ChatGPT and many more.

This is a backport of the ChatGPT binding as it will we shipped with openHAB 5.3.0.M1.
This means it includes support for the AI-powered Chat feature in Main UI and provides a LLM-powered human language interpreter.

:bookmark: README

Changelog

Changes to the official openHAB 5.2.0 binding are listed in the GitHub release, documenting which PRs have been backported:

Be aware of these (possibly) breaking changes:

  • apiUrl and modelUrl parameters of the account Thing have been replaced by baseUrl. Whilst backwards compatibility is kept, it is recommended to set baseUrl for all ChatGPT Things and remove apiUrl and modelUrl.
  • Every single account Thing now provides a HLI service with a ID of schema chatgpt:<thing-id>, replacing the single HLI service with chatgpt ID. You may need to set your default HLI in the Voice settings again and update your rules and scripts. For a Thing UID of chatgpt:account:acc1, the HLI id is chatgpt:acc1.

Resources

https://github.com/florian-h05/openhab-addons/releases/download/5.2.x-chatgpt-8f83ce3/org.openhab.binding.chatgpt-5.2.2-SNAPSHOT.jar

Hi Florian,

This is looking pretty great! I wonder if you could allow setting blank API key? On my LAN I do not desire LLM to require API key.

Blessings,

-Patrick

Hi,

I didn’t think of allowing a blank API key, but sure, for local Ollama it isn’t required.

I will update the binding.

I’ve just updated the binding and published a new version to the marketplace.

Has anyone tried this binding with local llms? I tried using Ollam and LM Studio, but the chat from the sidebar never worked for me. Please, if anyone has managed to run everything locally, tell me which model to use.

It never worked isn’t any helpful information for debugging or helping you …

Do the tested models support function/tool calling?

I’ve had very limited success with local models using this binding. Even models that work well with the MCP binding struggle with the chat feature. Many models fail to make any successful tools calls at all. Of those that can make the tool calls successfully, most fail to find the correct item. Here’s an “amusing” recent example. This is a 14b parameter model and instead of finding the item I have with the label “Office Lamp” the request to turn off that item instead sent the off command to my every light in the house group.

I’ve tried a bunch of different models over the last couple of weeks, so I can’t remember the exact details of success and fails. I think it was gemma 3.6 family of models that would very accurately accomplish the initial request and then make 10 - 20 additional tools calls sending random commands to random items and surfacing numerous completely unrelated item cards.

I don’t think the issue is entirely the binding however. You’re probably aware that Ollama isn’t OpenAI API compatible out of the box. I’ve been using OpenWebUi as an intermediary, and its tools calling is abysmal. Again, many of these models when connected to the MCP in something other than OpenWebUI, Anything LLM for example, work pretty well. I think my most successful has with the MCP has been lfm2.5, but gemma4:12b has also worked pretty well.

Hi all,

I’ve just updated the binding with the version that will likely be shipped with openHAB 5.3.0.M1, our upcoming milestone build. It still adds support for LLM-based HLIs, however it includes several fixes, mainly related to using different AI services in parallel, and also some minor breaking changes.

Have fun trying it out!