OpenHAB & AI: Integrazione completa di Gemini con lo Script AI2MQTT e il Protocollo MQTT / Full Gemini Integration with AI2MQTT Script and MQTT Protocol ITA ENG
In this video, I introduce my AI2MQTT script, a key step in integrating Gemini AI into smart home systems like OpenHAB.
AI2MQTT is a Python script (available on my GitHub repository https://github.com/domoticsduino/ai2mqtt) that acts as a bridge between home automation systems and the Gemini APIs. The script was designed to allow systems like OpenHAB, which may not have the technical capability to integrate directly with AI APIs, to leverage their power via the MQTT protocol, an efficient protocol widely used in home automation.
- Sending the Request: OpenHAB (or any external system) sends prompt requests to Gemini on a specific MQTT topic.
- Generic: The script remains generic because it doesn't have the prompt hardwired into it, but receives it via the MQTT payload.
- JSON Schema: The prompt request must include a JSON schema. This is crucial because the AI must return a schematic response rather than merely textual, making the data easily interpretable and usable by OpenHAB.
- Receiving the Response: Once the response is received from the Gemini 2.5 flash model, the script publishes it to a dedicated MQTT response topic, which is personalized with an identifier ('track') to separate responses to different requests.
In the video, I demonstrate installing and running the script using Docker Compose on a Raspberry Pi, and a practical test requesting a weather forecast for New York City, demonstrating the correct functioning of the AI2 MQTT bridge.
Enjoy the video
***********************************
In questo video ti presento il mio script AI2MQTT, un passo fondamentale per l'integrazione dell'Intelligenza Artificiale Gemini nei sistemi di smart home come OpenHAB
AI2MQTT è uno script in linguaggio Python (disponibile sul mio repository GitHub https://github.com/domoticsduino/ai2mqtt) che funge da bridge o ponte tra i sistemi domotici e le API di Gemini. Lo script è stato progettato per permettere ai sistemi come OpenHAB, che potrebbero non avere la capacità tecnica di integrarsi direttamente con le API dell'IA, di sfruttarne la potenza tramite il protocollo MQTT, un protocollo efficiente ampiamente utilizzato nell'automazione domestica.
- Invio della Richiesta: OpenHAB (o qualsiasi sistema esterno) invia le richieste di prompt a Gemini su uno specifico topic MQTT.
- Genericità: Lo script rimane generico perché non ha il prompt cablato al suo interno, ma lo riceve tramite il payload MQTT.
- Schema JSON: La richiesta di prompt deve includere uno schema JSON. Questo è fondamentale perché l'intelligenza artificiale deve restituire una risposta schematica invece che meramente testuale, rendendo i dati facilmente interpretabili e utilizzabili da OpenHAB.
- Ricezione della Risposta: Una volta ottenuta la risposta dal modello Gemini 2.5 flash, lo script la pubblica su un topic MQTT di risposta dedicato, che viene personalizzato con un identificativo ('track') per tenere separate le risposte a richieste diverse.
Nel video mostro l'installazione e l'esecuzione dello script tramite Docker Compose su un Raspberry Pi, e una prova pratica di richiesta di previsioni meteorologiche a New York, dimostrando il corretto funzionamento del bridge AI2 MQTT.
Buona visione
Video di mia proprietà
My own Video
Leave OpenHAB & AI: Integrazione completa di Gemini con lo Script AI2MQTT e il Protocollo MQTT / Full Gemini Integration with AI2MQTT Script and MQTT Protocol ITA ENG to:
Read more #hive-193212 posts
Best Posts From Marcolino
We have not curated any of marcolino76's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Marcolino
- Non riuscivo ad attivare i Webhook su SmartThings... poi ho fatto così. Iniziamo dalle SmartApps / I couldn't enable Webhooks on SmartThings... then I did this. Let's start with SmartApps ITA ENG
- OpenHAB 5: con il nuovo frigo SAMSUNG ho deciso di aggiornare la mia integrazione SMARTTHINGS / with the new SAMSUNG fridge I decided to update my SMARTTHINGS integration ITA ENG
- OPENHAB in PILLOLE: 64. CONSOLE - La gestione dei LOG / Log Management ITA ENG
- OPENHAB in PILLOLE: 63. CONSOLE - Il motore di OPENHAB - Bundle e Feature (Karaf) / The OPENHAB Engine - Bundles and Features (Karaf) ITA ENG
- OPENHAB in PILLOLE: 62. CONSOLE - Gestiamo ITEMS, THINGS e LINKS usando KARAF CONSOLE / We manage ITEMS, THINGS and LINKS using KARAF CONSOLE ITA ENG
- OPENHAB in PILLOLE: 61. DOCKER e la CONSOLE - Accesso facile anche senza il comando openhab-cli / DOCKER and the CONSOLE - Easy access even without the openhab-cli command ITA ENG
- OPENHAB in PILLOLE: 60. CONSOLE - Dalla teoria alla pratica - Accesso, Trucchi e Comandi Runtime / From Theory to Practice - Access, Cheats, and Runtime Commands ITA ENG
- OPENHAB in PILLOLE: 59. La CONSOLE - Entriamo nella Sala Macchine! Introduzione ad APACHE KARAF / OPENHAB in a NUTSHELL: 59. The Console - Enter the Engine Room! An Introduction to Apache Karaf ITA ENG
- OpenHAB 5: XIAOMI Cloud Login Error? Ecco come risolvere / Here's how to fix it (Bypass) ITA ENG
- OpenHAB 5 In arrivo un nuovo progetto con SONOFF e TASMOTA / A new project is coming with SONOFF e TASMOTA ITA ENG
- OpenHAB 5 & Matter: Addio Cloud! Integrazione SwitchBot Lock Pro e Hub Mini / Goodbye Cloud! SwitchBot Lock Pro and Hub Mini Integration ITA ENG
- OpenHAB & GOOGLE AI: Integrare Gemini AI in OpenHAB: Guida Completa con AI2MQTT / Integrating Gemini AI into OpenHAB: Complete Guide with AI2MQTT ITA / ENG
- OpenHAB & GOOGLE AI: Integrare Gemini AI in OpenHAB: Guida Completa con AI2MQTT / Integrating Gemini AI into OpenHAB: Complete Guide with AI2MQTT ITA / ENG
- OpenHAB 5: Ho installato l'aggiornamento alla versione 5.1 - Ho ROTTO TUTTO ma poi ho risolto! / I installed the 5.1 update - I BROKE EVERYTHING but then I fixed it! ITA ENG
- OpenHAB & AI: Integrazione completa di Gemini con lo Script AI2MQTT e il Protocollo MQTT / Full Gemini Integration with AI2MQTT Script and MQTT Protocol ITA ENG
- OpenHAB & AI: ho collegato Gemini a OpenHAB con Python e MQTT / I connected Gemini to OpenHAB with Python and MQTT 🤖⚡ITA ENG
- OpenHAB & IA: come poter integrare Gemini API in openHAB - il Segreto delle risposte in JSON / how to Integrate the Gemini API into openHAB - The Secret to JSON Responses ITA ENG
- OPENHAB 5: monitoraggio completo dello stato del matter bridge (items, regole e notifiche) / complete monitoring of the matter bridge status (items, rules, and notifications) ITA ENG
- Quattro passi in montagna - Estate 2025 - Rifugio Quintino Sella e Viso Mozzo da Crissolo PARTE 2 - Valle PO - Il racconto
- OPENHAB 5: Non perdere più lo stato del Matter Bridge! 🔔 Notifiche automatiche con OpenHAB / Never lose the status of your Matter Bridge again! 🔔 Automatic notifications with OpenHAB ITA ENG