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

User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

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

Post by waltervl »

I would suggest you ask AI for that.... :)
The answer I got was:
That’s a great question, Walter! Integrating AI with **Domoticz** can definitely open up some powerful possibilities, especially for:

### 🔍 Surveillance Analysis
Using AI models (like YOLO, OpenCV, or even cloud-based services) to:
- Detect people, vehicles, or unusual activity in camera feeds.
- Trigger Domoticz events (e.g., turn on lights, send alerts) based on detection.
- Filter out false positives (e.g., pets, shadows) to reduce noise.

### ⚙️ Automated Responses
AI can help:
- Adjust heating, lighting, or blinds based on learned patterns or weather forecasts.
- Respond to voice commands more intelligently (e.g., via Home Assistant + Domoticz bridge).
- Predict and preemptively act on sensor data (e.g., water leak detection triggering shutoff valves).

### 📊 Smart Reporting
You could use AI to:
- Summarize sensor logs into daily/weekly reports.
- Detect anomalies in energy usage or temperature trends.
- Generate natural language summaries (e.g., “The living room was unoccupied for 80% of the day”).

---

### 🛠️ How to Get Started
If you're curious to experiment, here are a few entry points:
- **Node-RED**: Acts as a bridge between Domoticz and AI services (like OpenAI, TensorFlow, or Hugging Face).
- **Python scripts**: Domoticz supports scripting, so you can run AI models locally or via API.
- **MQTT**: Use it to send sensor data to an external AI service and receive actionable insights.

---
I see no use case for myself except for "Detect anomalies in energy usage or temperature trends."
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 663
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

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

Post by HvdW »

I'm using AI for all my dzVents solutions nowadays.
Even more, nowadays when I find an API I ask AI if it can write a script to display the data.
Lately I display data in text sensors.

Here is an example for data from meteoserver.nl which is queried every 2 hours (free)
Screenshot_20250616_235534_Firefox.jpg
Screenshot_20250616_235534_Firefox.jpg (358.64 KiB) Viewed 2346 times
It calculates the expected sun radiation using a formula that accounts for low, medium and high cloud coverage.
All made up by AI.

Is it necessary? No.
Is it fun? Yes
From the first setup to completion like I wanted it took a bit more than 1 hour.
Last edited by HvdW on Tuesday 29 July 2025 16:04, edited 1 time in total.
Bugs bug me.
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

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

Post by waltervl »

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)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 663
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

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

Post by HvdW »

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)
Thanks Walter.
Tbh I didn't realize that.
Set it to 10 days.
Tomorrow I'll see the size difference of my domoticz.db
Last edited by HvdW on Tuesday 29 July 2025 17:14, edited 1 time in total.
Bugs bug me.
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

A couple of years ago I used Tensorflow in combination with intrusion detection.
This was a Node-RED application with a MQTT link to Domoticz.

Domoticz presented the "Alerts", if a person on camera had been detected in a specific area and was responsible for
activation/deactivation of specific (camera) zones.
See a brief description: viewtopic.php?p=268132&hilit=intrusion#p268132

This can also be used, if you want to use "Baby Monitoring" or similar things.

In general, AI combined with camera's, is quite common nowadays.

I abandoned the project, because I used it in a Node-RED instance, installed in a FreeBSD (TrueNAS) jail.
Unfortunately newer versions of Tensorflow did not support FreeBSD.

Regards
User avatar
Varazir
Posts: 482
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post by Varazir »

I have created few dzVents script using Gemini, some times you need to wrestle with the AI to get to work :)
Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

HvdW wrote: Tuesday 29 July 2025 15:51 I'm using AI for all my dzVents solutions nowadays.
Even more, nowadays when I find an API I ask AI if it can write a script to display the data.
Lately I display data in text sensors.

Here is an example for data from meteoserver.nl which is queried every 2 hours (free)
Screenshot_20250616_235534_Firefox.jpg
It calculates the expected sun radiation using a formula that accounts for low, medium and high cloud coverage.
All made up by AI.

Is it necessary? No.
Is it fun? Yes
From the first setup to completion like I wanted it took a bit more than 1 hour.
Nice to see.
NOWADAY? Erg benieuwd naar je script.. Dit zou ook met regen kunnen?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
HvdW
Posts: 663
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

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

Post by HvdW »

I write English for the sake of this forum.
Regen ook.
Screenshot_20250224_155141_Firefox.jpg
Screenshot_20250224_155141_Firefox.jpg (108.75 KiB) Viewed 2232 times
This is for one hour.
Just what I need to know if it is safe to go out shopping without a coat.

https://gpsgadget.buienradar.nl/data/ra ... xx&lon=yyy
Written in dzVents, author DeepSeek
Time to get this was less than an hour.
Bugs bug me.
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

sorry i now English.. only my dutch is better 🤒
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
gizmocuz
Posts: 2706
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 »

I don't think this was the original question.

There are (lightweight) c++ libraries that we can use to train our own model, and feed it with data (temp/power/solar/wind/lux etc etc)
And with this we could make predictions
When you have a system that has been running for some time (like months/years), you could initialy train the model with this data as well

You can also train a model for a light. When someone turns the light on manually always around 6.30am on Monday/Friday, this could be predicted and done automatically

If you known at night your house used 0.7kWh, you could make sure that a battery keeps a minimum load of xx %

and so on...

I tried some coding against 'mlpack', but had issues getting this to work on my main dev machine (cross platform)
I do think this could be a great library to use
Quality outlives Quantity!
User avatar
kiddigital
Posts: 447
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 see 2 ways for Domoticz where AI might be relevant.

First, using ‘traditional Machine Learning’ to make predictions for sensors. One could train an ML-model based on the historical data of a sensor and with such a model predict a few values in the future for such a sensor. Might be interesting for (light)switches to automatically turn things on or off without the need of a schedule. Just based on historical behavior. For more difficult predictions like weather, the small set of local measurements is insufficient to create a model that has some accuracy. Better use the predictions from already available hardware in Domoticz like Buienrader or OpenweatherMap which offer predictions already.

Second one is making Domoticz ‘accessible ‘ via an LLM like Claude, ChatGPT, Gemini, etc. This way a Chat/Agent gets understanding of the Domoticz setup by providing relevant context to the Chat/Agent. And provide methods for the Chat/Agent to have Domoticz perform actions.
(This second option is one I am currently trying to develop within Domoticz using the Model Context Protocol. Hope to release a Beta in the coming weeks).

Question: what would be actions that one would like to have performed in Domoticz by a (chat)Agent? (Next to the obvious control of switches, sensor setters, reading current sensor values, etc.)
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
solarboy
Posts: 357
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

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

Post by solarboy »

Live log analysis would be good, for spotting errors and anomalies or whatever you want and then sending "intelligent" notifications. This could also include syslog, and other logs (zwave,zigbee etc).

There are so many things ML could do although I am not sure I would let it have too much control without verification.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
kiddigital
Posts: 447
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 »

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!
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
User avatar
Thuis
Posts: 281
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post by Thuis »

I used ai to make a python plugin for my google speakers, so Domoticz can "speak" notifications. It creates a mp3 and then talks. Very long sentences is possible. It is added as an notification subsytem. Works great !

I used it to get as close to a "feeling" temperature inside the house. It uses the wind, solar, humidity, temperature, inside and outside, know east and west for the heating of the bricks of the house and so on. Then it steers my AC. Heating as well as cooling. It is always the same temperature in house and that feels great !

I also used ai to make a dzvents to steer the ventialtion of the house, it looks at humidity and CO2 in different rooms. Also it is coupled to the AC script, they work together. So if it is hot inside but cold outside, the ventilstion will work harder to get cool air in from outside so ac does not have to work hard. Other way around, when cold inside and hot outside, it can do the same.

So yes, i use AI tools with Domoticz :-)
If you can not handle a computer, you buy a Mac. If you can not handle domotica, you use Homeassistant!
solarboy
Posts: 357
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

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

Post by solarboy »

I used it to create a python script I call my "moon-o-meter". it calculates moon brightness by using elevation, cloud cover and moon phase and updates a percentage device. I use that to inhibit my outdoor lighting when the moon is bright because it's beautiful outside with just the bright moon.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
kiddigital
Posts: 447
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 »

solarboy wrote: Saturday 09 August 2025 16:39 Live log analysis would be good, for spotting errors and anomalies or whatever you want and then sending "intelligent" notifications. This could also include syslog, and other logs (zwave,zigbee etc).

There are so many things ML could do although I am not sure I would let it have too much control without verification.
Well @solarboy , retrieving domoticz logging is now supported in the (draft) PR for MCP support. So it can be analyzed by an LLM. Results are nice and interesting. It (testing using Claude and VSCode/Copilot) gives good summaries and highlights. Give it a try...
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
solarboy
Posts: 357
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

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

Post by solarboy »

This is great news. Is it able to be used with offline LLM's ?
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
kiddigital
Posts: 447
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 »

solarboy wrote:This is great news. Is it able to be used with offline LLM's ?
It is not specifically designed for that purpose, but as it uses generic MCP (Model Context Protocol) it definitely can be used with offline LLM’s.
Tools like LMstudio, Tome, LibreChat should work fine.
Give it a go and any feedback is welcome.
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
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

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

Post by waltervl »

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

Let me know what the experiences are!
That Draft PR is now merged into latest beta 2025.2 so can be used without extra actions.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
kiddigital
Posts: 447
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 »

waltervl wrote: Sunday 19 October 2025 18:04
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 ....

Let me know what the experiences are!
That Draft PR is now merged into latest beta 2025.2 so can be used without extra actions.
Correct, but don't forget it needs to be enabled by specifying

Code: Select all

-mcp
as a startup flag. The log should tell you that it is enabled.
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest