Using AI tools with Domoticz, anyone given it a go?

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

zicht
Posts: 308
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by zicht »

waltervl wrote: Tuesday 29 July 2025 16:03
HvdW wrote: Tuesday 29 July 2025 15:51 Lately I display data in text sensors.
This will let your database grow rapidly!! check the Light/Switches log settings to minimize this (default 30 days)
I have made a timebased script to flush all my text sensors once in a day, that can easaly be done in scripting using the json url and your idx to build a function for that. That way you can keep the history on bulbs etc and only flush the text devices, as the text data is mostly overdue the next day. I even clean device logs this way for think i dont need history from.

( i have space wether, Earthquake world and Nl, Neraby traffic, weather, solar pred., NLalert and so on and can confirm db grows x mB in a day when doing nothing.)
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
zicht
Posts: 308
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by zicht »

I use openrouter Free tier for somethings :
- Predict minimal temp in living room overnight --> usefull for some pets to turn local heating (not CV) on at night, based on wether prediction, cooldown factor is calculated during the day, outside and inside actual measuments to fine tune.
- I have a homebrew telegram integration and i use also speech interaction with local STT speech to text conversion (local python service). I use openrouter to correct detect the intention of the phrase and then translate local to a domoticz command.
- I use opencv for facerecognition there are some good examples all over github for this, no external needed, but its needs some "training" of the model.

Edit : I forget light prediction, sleepint time and pattern recognition to adjust light, heating and so on. Turns out family finds it scaring so abandoned that. (it was recognising patterns for wakeup, sleeping , cooking, heating & arrival times etc.) They constantly asked how can it know that ? I dont like it to know so much of me... ( i trained them to be aware of things in the past lolz) Sow when starting be prepaired for the WAF discussion :P ... It is indeed strange to see the light going on the hallway and toilet and shorly before that some is going to the toilet -> i learned we have more patterns than we aware of. I deleted it after a while. The goal is to automated naturaly and not to get people wonder whats going on or freaking out.

Other than that most other things can just be done with math, no AI use needed & i dont like to be depended on the cloud
Its all still expirementel and not robust enough to share yet. (build some parts of it with GPT5).
Next year i prob will abandon openrouter completely as there is a local solution for my STT recognition to improve.
It was just to see what i can do and a nice timespening exploring the models.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
zicht
Posts: 308
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by zicht »

kiddigital wrote: Saturday 13 September 2025 21:47 As mentioned a few weeks ago, I created something as a 'domoticz agent' using MCP. A Draft PR is available now :)

Curious to hear/read/see if/how domoticz users leverage this and what is missing/wrong/need improvements.

As it is a separate PR and not part of the Beta builds, you either need to build/compile it yourself or download the Linux artifact from a recent GitHub action.

Let me know what the experiences are!
would love to see some kind of lMM into domoticz, looks pretty nice ! (just not enough time to test right now.)
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

Can't belive that there is already a MCP server implemented in Domoticz. Awsome! I just tried to configure it in my local LLM setup (using llama.cpp with it's WEB-Client). Unfortunately that fails:

MCP Dialog.png
MCP Dialog.png (73.6 KiB) Viewed 15770 times

llama.cpp server shows srv

Code: Select all

log_server_r: done request: GET /cors-proxy 192.168.100.79 404
MCP service is running according to the Domoticz log (I used -mcp as parameter for startup). If I manually call http://192.168.100.100:8080/mcp I get a 400 Bad Request. I'm not into MCP t all. Is that th eexpected behaiviour?
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

Check the domoticz logging. You can enable debug messages by enabling that through the command line startup parameters (see wiki).

I guess maybe authorization issues. Best to provide separate user credentials in domoticz that the agent should use to call the mcp functions. Easier (less secure) is to ensure that your agent is within the local network (see wiki).
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

Here's the log (sorry, so many devices, Plugins etc.):

Code: Select all

2026-03-15 14:57:02.612  Debug: [web:8080] Host:192.168.100.79 Uri:/mcp
2026-03-15 14:57:02.612  Debug: [web:8080] Request Headers:
Host: 192.168.100.100:8080
Connection: keep-alive
Accept: */*
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: http://192.168.100.128:11434
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Sec-Fetch-Mode: cors
Referer: http://192.168.100.128:11434/
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7

2026-03-15 14:57:02.612  Debug: Web ACLF: 192.168.100.79 - - [15/Mar/2026:14:57:02.612 +0100] "OPTIONS /mcp HTTP/1.1" 200 0 "http://192.168.100.128:11434/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36"
2026-03-15 14:57:02.615  Debug: [web:8080] Host:192.168.100.79 Uri:/mcp
2026-03-15 14:57:02.615  Debug: [web:8080] Request Headers:
Host: 192.168.100.100:8080
Connection: keep-alive
Content-Length: 192
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
accept: application/json, text/event-stream
content-type: application/json
Origin: http://192.168.100.128:11434
Referer: http://192.168.100.128:11434/
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7

2026-03-15 14:57:02.615  Debug: [web:8080] IP (192.168.100.79) is within Trusted network range!
2026-03-15 14:57:02.615  Debug: MCP: Request method: initialize
2026-03-15 14:57:02.615  Debug: MCP: Handling initialize request.
2026-03-15 14:57:02.616  Debug: Web ACLF: 192.168.100.79 - - [15/Mar/2026:14:57:02.615 +0100] "POST /mcp HTTP/1.1" 200 389 "http://192.168.100.128:11434/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36"
2026-03-15 14:57:02.621  Debug: [web:8080] Host:192.168.100.79 Uri:/mcp
2026-03-15 14:57:02.621  Debug: [web:8080] Request Headers:
Host: 192.168.100.100:8080
Connection: keep-alive
Accept: */*
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,mcp-protocol-version
Origin: http://192.168.100.128:11434
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Sec-Fetch-Mode: cors
Referer: http://192.168.100.128:11434/
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7

2026-03-15 14:57:02.622  Debug: Web ACLF: 192.168.100.79 - - [15/Mar/2026:14:57:02.621 +0100] "OPTIONS /mcp HTTP/1.1" 200 0 "http://192.168.100.128:11434/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36"
2026-03-15 14:57:03.081  Debug: [web:8080] Host:192.168.100.100 Uri:/json.htm?type=command&param=udevice&idx=2695&nvalue=0&svalue=99.9
2026-03-15 14:57:03.081  Debug: [web:8080] Request Headers:
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
User-Agent: Mozilla/4.0 (compatible; ICS)
Host: 192.168.100.100:8080
Pragma: no-cache

2026-03-15 14:57:03.081  Debug: [web:8080] IP (192.168.100.100) is within Trusted network range!
2026-03-15 14:57:03.081  Debug: CWebServer::GetJSonPage: udevice : /json.htm?type=command&param=udevice&idx=2695&nvalue=0&svalue=99.9
2026-03-15 14:57:03.085  Debug: CWebServer::GetJSonPage: getdevices : /json.htm?type=command&param=getdevices&rid=2695
2026-03-15 14:57:03.094  Debug: Web ACLF: 192.168.100.100 - - [15/Mar/2026:14:57:03.081 +0100] "GET /json.htm?type=command&param=udevice&idx=2695&nvalue=0&svalue=99.9 HTTP/1" 200 49 - "Mozilla/4.0 (compatible; ICS)"
2026-03-15 14:57:03.098  Debug: [web:8080] Host:192.168.100.100 Uri:/json.htm?type=command&param=udevice&idx=2693&nvalue=0&svalue=53.99
2026-03-15 14:57:03.098  Debug: [web:8080] Request Headers:
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
User-Agent: Mozilla/4.0 (compatible; ICS)
Host: 192.168.100.100:8080
Pragma: no-cache

2026-03-15 14:57:03.100  Debug: [web:8080] IP (192.168.100.100) is within Trusted network range!
2026-03-15 14:57:03.100  Debug: CWebServer::GetJSonPage: udevice : /json.htm?type=command&param=udevice&idx=2693&nvalue=0&svalue=53.99
2026-03-15 14:57:03.102  Debug: CWebServer::GetJSonPage: getdevices : /json.htm?type=command&param=getdevices&rid=2693
2026-03-15 14:57:03.112  Debug: Web ACLF: 192.168.100.100 - - [15/Mar/2026:14:57:03.098 +0100] "GET /json.htm?type=command&param=udevice&idx=2693&nvalue=0&svalue=53.99 HTTP/1" 200 49 - "Mozilla/4.0 (compatible; ICS)"
2026-03-15 14:57:03.120  Debug: [web:8080] Host:192.168.100.100 Uri:/json.htm?type=command&param=udevice&idx=2694&nvalue=0&svalue=0
2026-03-15 14:57:03.120  Debug: [web:8080] Request Headers:
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
User-Agent: Mozilla/4.0 (compatible; ICS)
Host: 192.168.100.100:8080
Pragma: no-cache

2026-03-15 14:57:03.120  Debug: [web:8080] IP (192.168.100.100) is within Trusted network range!
2026-03-15 14:57:03.120  Debug: CWebServer::GetJSonPage: udevice : /json.htm?type=command&param=udevice&idx=2694&nvalue=0&svalue=0
2026-03-15 14:57:03.121  Debug: CWebServer::GetJSonPage: getdevices : /json.htm?type=command&param=getdevices&rid=2694
2026-03-15 14:57:03.128  Debug: Web ACLF: 192.168.100.100 - - [15/Mar/2026:14:57:03.120 +0100] "GET /json.htm?type=command&param=udevice&idx=2694&nvalue=0&svalue=0 HTTP/1" 200 49 - "Mozilla/4.0 (compatible; ICS)"
2026-03-15 14:57:03.135  Debug: [web:8080] Host:192.168.100.100 Uri:/json.htm?type=command&param=udevice&idx=5200&nvalue=0&svalue=0.028
2026-03-15 14:57:03.135  Debug: [web:8080] Request Headers:
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
User-Agent: Mozilla/4.0 (compatible; ICS)
Host: 192.168.100.100:8080
Pragma: no-cache

2026-03-15 14:57:03.135  Debug: [web:8080] IP (192.168.100.100) is within Trusted network range!
2026-03-15 14:57:03.135  Debug: CWebServer::GetJSonPage: udevice : /json.htm?type=command&param=udevice&idx=5200&nvalue=0&svalue=0.028
2026-03-15 14:57:03.135  Debug: CWebServer::GetJSonPage: getdevices : /json.htm?type=command&param=getdevices&rid=5200
2026-03-15 14:57:03.143  Debug: Web ACLF: 192.168.100.100 - - [15/Mar/2026:14:57:03.132 +0100] "GET /json.htm?type=command&param=udevice&idx=5200&nvalue=0&svalue=0.028 HTTP/1" 200 49 - "Mozilla/4.0 (compatible; ICS)"
2026-03-15 14:57:03.562  Debug: [web:443] Host:192.168.100.85 Uri:/api/20a47974fa824b7ca10c589c3a852929/lights/138
2026-03-15 14:57:03.562  Debug: [web:443] Request Headers:
Host: 192.168.100.100
Accept: */*
Content-Type: application/json

2026-03-15 14:57:03.562  Debug: [web:443] IP (192.168.100.85) is within Trusted network range!
2026-03-15 14:57:03.562  Debug: [web:/api/20a47974fa824b7ca10c589c3a852929/lights/138] unable to determine extension for C:\Program Files (x86)\Domoticz\www/api/20a47974fa824b7ca10c589c3a852929/lights/138!
2026-03-15 14:57:03.562  Debug: Web ACLF: 192.168.100.85 - - [15/Mar/2026:14:57:03.562 +0100] "GET /api/20a47974fa824b7ca10c589c3a852929/lights/138 HTTP/1.1" 400 89 - -
2026-03-15 14:57:03.635  Debug: [web:443] Host:192.168.100.85 Uri:/api/20a47974fa824b7ca10c589c3a852929/lights/138
2026-03-15 14:57:03.635  Debug: [web:443] Request Headers:
Host: 192.168.100.100
Accept: */*
Content-Type: application/json

2026-03-15 14:57:03.635  Debug: [web:443] IP (192.168.100.85) is within Trusted network range!
2026-03-15 14:57:03.635  Debug: [web:/api/20a47974fa824b7ca10c589c3a852929/lights/138] unable to determine extension for C:\Program Files (x86)\Domoticz\www/api/20a47974fa824b7ca10c589c3a852929/lights/138!
2026-03-15 14:57:03.635  Debug: Web ACLF: 192.168.100.85 - - [15/Mar/2026:14:57:03.635 +0100] "GET /api/20a47974fa824b7ca10c589c3a852929/lights/138 HTTP/1.1" 400 89 - -
2026-03-15 14:57:04.312  Debug: [web:443] cleaning sessions...
2026-03-15 14:57:04.312  Debug: [web:8080] cleaning sessions...
2026-03-15 14:57:05.189  Debug: [web:8080] Host:192.168.100.69 Uri:/json.htm?type=command&param=udevice&idx=2684&nvalue=0&svalue=18072824.00;0;30881094.00;0;0;1432.00
2026-03-15 14:57:05.189  Debug: [web:8080] Request Headers:
Host: 192.168.100.100:8080
User-Agent: ESP8266HTTPClient
Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0
Connection: keep-alive
Content-Length: 0
192.168.100.128:11434 is the llama server, the requesting client browser is on 192.168.100.79, the Domoticz server on 192.168.100.100. All in one local network.
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

The log shows that only an ‘initialize’ call to the MCP server is done, but no follow up calls requesting the list of tools, resources, etc.

Looks like the ‘agent’ just hallucinates the API calls to domoticz instead of using the provided tools. The called API endpoints do not exist (hence the 400/404).

Try it with for example Claude or VScode to get the MCP interaction right.

A ‘limitation’ of the current implementation is that it uses Streamable HTTP (and not SSE or ‘stdio’), but does not fully support websocket for a persistent connection.
The current calls are stateless. That could potentially throw off certain clients that have no fallback when the connection closes.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

Hm, I tried with LM-Studio but similar issue:

Code: Select all

2026-03-15 17:50:32 [DEBUG]
 [LMSAuthenticator][Client=plugin:installed:mcp/domoticz-mcp] Client created.
2026-03-15 17:50:37 [ERROR]
 [Plugin(mcp/domoticz-mcp)] stderr: Error in LM Studio MCP bridge process: _0x55f46e [Error]: SSE error: TypeError: fetch failed: connect ECONNREFUSED 192.168.100.128:8080
    at <computed>.<computed> (C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:217411)
    at _0x4350e1._0xa17b84 (C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:360395)
    at C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:355085
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: undefined,
  event: {
    type: 'error',
    message: 'TypeError: fetch failed: connect ECONNREFUSED 192.168.100.128:8080',
    code: undefined,
    defaultPrevented: false,
    cancelable: false,
    timeStamp: 4468.0408
  }
}
2026-03-15 17:50:37 [ERROR]
 [Plugin(mcp/domoticz-mcp)] stderr: _0x55f46e [Error]: SSE error: TypeError: fetch failed: connect ECONNREFUSED 192.168.100.128:8080
    at <computed>.<computed> (C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:217411)
    at _0x4350e1._0xa17b84 (C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:360395)
    at C:\Users\yavuz\AppData\Local\Programs\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:29:355085
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: undefined,
  event: {
    type: 'error',
    message: 'TypeError: fetch failed: connect ECONNREFUSED 192.168.100.128:8080',
    code: undefined,
    defaultPrevented: false,
    cancelable: false,
    timeStamp: 4468.0408
  }
}
2026-03-15 17:50:37 [DEBUG]
 [LMSAuthenticator][Client=plugin:installed:mcp/domoticz-mcp] Client disconnected.
Can you advice which concrete Chat-Client (for Windows) work with which LLM-Modell?
Last edited by Itschi on Sunday 15 March 2026 17:52, edited 1 time in total.
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

I have been successful with Claude and VScode.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

Did you use a local LLM?
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

No, haven’t tried that yet..
Your agent/client needs to leverage the local LLM..
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

I've installed a test instance to have a clean log:

Code: Select all

2026-03-19 16:45:07.720  Debug: [web:8080] Host:192.168.100.128 Uri:/mcp
2026-03-19 16:45:07.722  Debug: [web:8080] Request Headers:
2026-03-19 16:45:07.722 Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
2026-03-19 16:45:07.722 Connection: keep-alive
2026-03-19 16:45:07.722 Host: 192.168.100.81
2026-03-19 16:45:07.722 Content-Length: 192
2026-03-19 16:45:07.722 Origin: http://192.168.100.128:11434
2026-03-19 16:45:07.722 Cookie: sidebar:state=true
2026-03-19 16:45:07.722 Referer: http://192.168.100.128:11434/
2026-03-19 16:45:07.722 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
2026-03-19 16:45:07.722 accept: application/json, text/event-stream
2026-03-19 16:45:07.722 content-type: application/json
2026-03-19 16:45:07.724  Debug: [web:8080] IP (192.168.100.128) is within Trusted network range!
2026-03-19 16:45:07.728  Debug: MCP: Request method: initialize
2026-03-19 16:45:07.731  Debug: MCP: Handling initialize request.
2026-03-19 16:45:07.733  Debug: Web ACLF: 192.168.100.128 - - [19/Mar/2026:16:45:07.720 +0100] "POST /mcp HTTP/1.1" 200 671 "http://192.168.100.128:11434/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"
2026-03-19 16:45:07.756  Debug: [web:8080] Host:192.168.100.128 Uri:/mcp
2026-03-19 16:45:07.756  Debug: [web:8080] Request Headers:
2026-03-19 16:45:07.756 Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
2026-03-19 16:45:07.756 Connection: keep-alive
2026-03-19 16:45:07.756 Host: 192.168.100.81
2026-03-19 16:45:07.756 Content-Length: 54
2026-03-19 16:45:07.756 Origin: http://192.168.100.128:11434
2026-03-19 16:45:07.756 Cookie: sidebar:state=true
2026-03-19 16:45:07.756 Referer: http://192.168.100.128:11434/
2026-03-19 16:45:07.756 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
2026-03-19 16:45:07.756 accept: application/json, text/event-stream
2026-03-19 16:45:07.756 content-type: application/json
2026-03-19 16:45:07.756 mcp-protocol-version: 2025-06-18
2026-03-19 16:45:07.756  Debug: [web:8080] IP (192.168.100.128) is within Trusted network range!
2026-03-19 16:45:07.758  Debug: MCP: Request method: notifications/initialized
2026-03-19 16:45:07.758  Debug: MCP: Handling notification notifications/initialized (do nothing).
2026-03-19 16:45:07.758  Debug: Web ACLF: 192.168.100.128 - - [19/Mar/2026:16:45:07.756 +0100] "POST /mcp HTTP/1.1" 204 0 "http://192.168.100.128:11434/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"
I still had no luck to get MCP runnning with popular chat clients (Open WebUI, Lobe Chat, llama.cpp's own WebUI-Client) as they all run into the same error:

Code: Select all

Streamable HTTP error: Error POSTing to endpoint...
It does work with VS-Code but I don't consider this as a practical usable LLM-frontend. I've seen anonther stdio-base MCP Server implementation that I could try with a stdio to http/streamable converter but that's obviously the scond best solution.

Would it be possible to check what's missing to get the Domoticz native MCP sever working with these standard clients?
willemd
Posts: 793
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.3
Location: The Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by willemd »

I sometimes use an AI tool to help in debugging, when I have been staring at my code and can't find the error.
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

As mentioned earlier, the current MCP implementation is not fully streaming capable (yet). It does not keep an open websocket connection. Clients that depend on that might not work as expected. Something I want to look into when time permits (unless someone beats me to it ).
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
gmarchionni
Posts: 32
Joined: Sunday 11 June 2017 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by gmarchionni »

i found out that it does not work with claude desktop, claude web, chatgpt and i have not found an option in ollama to configure a mcp server.

But i managed to have it run in Claude code, via ssh and it works.....
I found that it was pretty slow because of claude doing lots of operations....but i guess one day it will be useful.
Just not at the moment....i found more useful Alexa or siri...it's way way faster and does not require an account.
In the future i guess AI will become faster and hopefully it will be much more useful.

But i think the work done on domoticz it has been pretty remarkable. It's been future proofed i guess. thanks!!
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by kiddigital »

For more info see the wiki at

https://wiki.domoticz.com/MCP_model_con ... otocol_LLM

It can work with Claude Desktop using an MCP proxy.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

There is a nice alternativ solution of an MCP server from @domovincent that can be found here: https://github.com/adrighem/domoticz-mcp

Also it only supports stdio it can be combined with supergateway available at https://github.com/supercorp-ai/supergateway which acts as a stdio to streamable http adapter. With that you can use it with almost any chat client.

The insatllation of the MCP sever and supergateway ist pretty straight forward. See their instructions on github. I had issues with supergateways docker image but the standard installation works fine. After the installation you just have to start supergateway like:
Code: Select all

npx -y supergateway --stdio "set DOMOTICZ_URL="http://192.168.100.100:8080" && C:\mcp\Domoticz\domoticz-mcp\.venv\Scripts\domoticz-mcp.exe" --outputTransport streamableHttp --port 8099
Change IP, ports and path to the MCP server according to your installation.

As a result you can see here the MCP server in llama.cpp's WebUI. It comes with an extensive toolset (only fraction of it can be seen on the screenshot) that allows practical everything that's possible in Domoticz.
Screenshot 2026-03-21 104913.png
Screenshot 2026-03-21 104913.png (44.42 KiB) Viewed 15324 times
Herer is a test query:
Screenshot 2026-03-21 105325.png
Screenshot 2026-03-21 105325.png (44.82 KiB) Viewed 15324 times
Many thanks again to @domovincent who did a great job here and of course to suprgateway as well as to @KitDigital who did the first move within Domoticz.
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

The build in Domoticz MCP service has had quite the updates in the last days. The documentation has been updated

https://wiki.domoticz.com/MCP_model_con ... otocol_LLM

I am almost sure anything is possible now, but if there are wishes, please request them on github
Quality outlives Quantity!
matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by matrek »

Hey, I tried updating it today, and it successfully went to the stable version 2026.1 via Docker Compose, but the MCP server doesn't seem to be working at all returning 400 Bad Request:
Screenshot 2026-03-30 at 1.48.36 PM.jpg
Screenshot 2026-03-30 at 1.48.36 PM.jpg (48.13 KiB) Viewed 15109 times

Code: Select all

$ curl -vvv "localhost:8080/mcp" -H "Accept: text/event-stream"
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /mcp HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.88.1
> Accept: text/event-stream
>
< HTTP/1.1 400 Bad Request
< Content-Length: 89
< Content-Type: text/html;charset=UTF-8
<
* Connection #0 to host localhost left intact
<html><head><title>Bad Request</title></head><body><h1>400 Bad Request</h1></body></html>%
Docker compose file:

Code: Select all

services:
  domoticz:
    image: domoticz/domoticz:stable
    container_name: domoticz
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - .....
    networks:
      - network
    environment:
      - TZ=Europe/Warsaw
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log
      - EXTRA_CMD_ARG=-loglevel normal,status,error
Any suggestions on what might be wrong or what I can check?
Last edited by matrek on Monday 30 March 2026 17:33, edited 3 times in total.
User avatar
waltervl
Posts: 7019
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by waltervl »

Check the Authentication and security section of the MCP wiki https://wiki.domoticz.com/MCP_model_con ... &_Security
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply