<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bilder mittels LLM ChatGPT Vision ananalysieren]]></title><description><![CDATA[<p dir="auto">LÖSUNG MEINER FRAGE VON UNTEN IN DIESEM BEITRAG</p>
<p dir="auto">Hallo,</p>
<p dir="auto">ich möchte hier gerne meine Lösung (danke an alle hier im Thread die geholfen haben) zum Analysieren von Bildern mittels ioBroker vorstellen.</p>
<p dir="auto">Die Bilder werden mittels GPT Vision analysiert.</p>
<p dir="auto">Dazu benötigt man nur folgende kleine Funktion in Blockly:</p>
<p dir="auto"><img src="/assets/uploads/files/1734333283710-1e5476c2-0f36-4121-aae4-f25fcdc688cc-image.png" alt="1e5476c2-0f36-4121-aae4-f25fcdc688cc-image.png" class="img-markdown  img-fluid" /><br />
</p><section class="spoiler-wrapper"><button class="spoiler-control btn btn-default">Blockly</button><section style="display:none" class="spoiler-content"><p></p>
<pre><code>&lt;block xmlns="https://developers.google.com/blockly/xml" type="procedures_defcustomnoreturn" id="jsyp;7{c1^]s%u;Qm.[B" x="313" y="-662"&gt;
 &lt;mutation statements="false"&gt;
   &lt;arg name="Bildpfad" varid="#^~=}RQE~[:hE?sXCoB$"&gt;&lt;/arg&gt;
   &lt;arg name="api_key" varid="o2iepdh*h(;FbS4Z=9{J"&gt;&lt;/arg&gt;
   &lt;arg name="Frage" varid="Uh*o[9LxAdT1B2TiZdAr"&gt;&lt;/arg&gt;
   &lt;arg name="DP_Antwort" varid="$xhtlk=y!MtLBX7u:Zew"&gt;&lt;/arg&gt;
 &lt;/mutation&gt;
 &lt;field name="NAME"&gt;Bildanalyse&lt;/field&gt;
 &lt;field name="SCRIPT"&gt;Y29uc3QgZnMgPSByZXF1aXJlKCdmcycpOw0KY29uc3QgT3BlbkFJID0gcmVxdWlyZSgnb3BlbmFpJyk7DQogDQovLyBWYX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3VzZXInLA0KICAgICAgICAgY29udGVudDogWw0KICAgICAgICAgICB7DQogICAgICAgICAgICAgdHlwZTogJ3RleHQnLA0KICAgICAgICAgICAgIHRleHQ6IFFVRVNUSU9OLCAvLyBWZXJ3ZW5kZSBkaWUgVmFyaWFibGUgZsO8ciBkaWUgRnJhZ2UNCiAgICAgICAgICAgfSwNCiAgICAgICAgICAgew0KICAgICAgICAgICAgIHR5cGU6ICdpbWFnZV91cmwnLA0KICAgICAgICAgICAgIGltYWdlX3VybDogew0KICAgICAgICAgICAgICAgdXJsOiBgZGF0YTppbWFnZS9qcGVnO2Jhc2U2NCwke2Jhc2U2NEltYWdlfWAsDQogICAgICAgICAgICAgfSwNCiAgICAgICAgICAgfSwNCiAgICAgICAgIF0sDQogICAgICAgfSwNCiAgICAgXSwNCiAgICAgIm1heF90b2tlbnMiOiA1MDAwDQogICB9KTsNCiANCiAgIC8vIE51ciBkZW4gY29udGVudCBhdXMgZGVyIEFudHdvcnQgenVyw7xja2dlYmVuDQogICByZXR1cm4gcmVzcG9uc2UuY2hvaWNlc1swXS5tZXNzYWdlLmNvbnRlbnQ7DQogfSBjYXRjaCAoZXJyb3IpIHsNCiAgIGNvbnNvbGUuZXJyb3IoJ0Vycm9yOicsIGVycm9yKTsNCiB9DQp9DQogDQovLyBGdW5rdGlvbiBhdXNmw7xocmVuDQphbmFseXplSW1hZ2UoKS50aGVuKChyZXN1bHQpID0+IHsNCg0KIHNldFN0YXRlKERQLCByZXN1bHQsIHRydWUpOw0KIA0KfSk7DQogDQo=&lt;/field&gt;
 &lt;comment pinned="false" h="80" w="160"&gt;Beschreibe diese Funktion …&lt;/comment&gt;
&lt;/block&gt;
</code></pre>
<p dir="auto"></p></section></section><p></p>
<ul>
<li>Unter Bildpfad muss der Pfad zum Bild angegeben werden was analysiert werden soll</li>
<li>Unter api_key euer openAI Api Key.</li>
<li>Unter Frage die Frage zum Bild</li>
<li>Unter DP_Antwort ein DP in den die Antwort geschrieben werden soll.</li>
</ul>
<p dir="auto">Damit das Blockly funktioniert müssen in den Settings vom Javascript-Adapter diese 2 Module hinzugefügt werden.</p>
<p dir="auto">In der Javascriptinstanz noch folgende 2 Module hinzufügen.<br />
<img src="/assets/uploads/files/1734095420798-c9090244-d9a4-41f9-b896-680411412654-image.png" alt="c9090244-d9a4-41f9-b896-680411412654-image.png" class="img-markdown  img-fluid" /></p>
<p dir="auto">Man könnte zB so Bilder seiner Überwachungskamera Analysieren:<br />
<img src="/assets/uploads/files/1734333556995-3eb6fb1c-9f72-4e90-bb20-0856bf220684-image.png" alt="3eb6fb1c-9f72-4e90-bb20-0856bf220684-image.png" class="img-markdown  img-fluid" /></p>
<p dir="auto">Zum testen hab ich auch einen kleinen "Bot" für Telegram geschrieben.<br />
Das sieht dann so aus:<br />
<img src="/assets/uploads/files/1734199700055-screenshot_20241214_190706_telegram.jpg" alt="Screenshot_20241214_190706_Telegram.jpg" class="img-markdown  img-fluid" /><br />
_ _<br />
Hallo,</p>
<p dir="auto">ich weiß nicht so ganz, ob ich hier im Bereich richtig bin.<br />
Meine Frage ist sehr allgemein.....<br />
Falls es möglich ist, dann vermutlich mit JS.....</p>
<p dir="auto">Ich habe folgendes für HA gesehen und finde es ziemlich cool:<br />
<a href="https://community.home-assistant.io/t/llm-vision-let-home-assistant-see/729241" rel="nofollow ugc">https://community.home-assistant.io/t/llm-vision-let-home-assistant-see/729241</a></p>
<p dir="auto">Man kann Bilder nach OpenAI etc hochladen und analysieren lassen.</p>
<p dir="auto">Bekommt man sowas als Script umgesetzt?<br />
Lokales Bild hochladen, Frage mitgeben und dann eine Antwort bekommen?</p>
<p dir="auto">Zu einer Api von OpenAI finde ich nichts....</p>
]]></description><link>https://forum.iobroker.net/topic/78608/bilder-mittels-llm-chatgpt-vision-ananalysieren</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 16:52:29 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/78608.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Dec 2024 19:14:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Mon, 16 Dec 2024 07:48:24 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte in <a href="/post/1228244">Bilder mittels LLM ChatGPT Vision ananalysieren</a>:</p>
<blockquote>
<p dir="auto">Die Bilder werden mittels GPT Vision analysiert.</p>
</blockquote>
<p dir="auto">Hallo David!</p>
<p dir="auto">Hab dein Blockly hier in der <a href="https://forum.iobroker.net/topic/77038/scriptsammlung-vol-2/3?_=1734335029806">Sammlung</a> aufgenommen. :)</p>
]]></description><link>https://forum.iobroker.net/post/1229354</link><guid isPermaLink="true">https://forum.iobroker.net/post/1229354</guid><dc:creator><![CDATA[Negalein]]></dc:creator><pubDate>Mon, 16 Dec 2024 07:48:24 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Sat, 14 Dec 2024 18:08:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul53" aria-label="Profile: paul53">@<bdi>paul53</bdi></a><br />
Okay, das ist ein gehbarer Workarround.<br />
Wenn ich nicht schön anzuschauen 🤣</p>
<p dir="auto">Edit<br />
Hab noch keinen wirklichen Einsatzzweck, aber eine Art Chatbot zum testen klappt schonmal ^^.</p>
<p dir="auto"><img src="/assets/uploads/files/1734199682521-screenshot_20241214_190702_chrome.jpg" alt="Screenshot_20241214_190702_Chrome.jpg" class="img-markdown  img-fluid" /></p>
<p dir="auto"><img src="/assets/uploads/files/1734199700055-screenshot_20241214_190706_telegram.jpg" alt="Screenshot_20241214_190706_Telegram.jpg" class="img-markdown  img-fluid" /></p>
]]></description><link>https://forum.iobroker.net/post/1228974</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228974</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Sat, 14 Dec 2024 18:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Sat, 14 Dec 2024 16:16:49 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte: Bleibt also nur ein normales JS?</p>
<p dir="auto">Du kannst das Ergebnis in einen eigenen Datenpunkt schreiben und diesen dann auswerten.</p>
<pre><code>analyzeImage().then((result) =&gt; {
  console.log(result);
  setState('0_userdata.0.OpenAI.Antwort', result, true);
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/1228971</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228971</guid><dc:creator><![CDATA[paul53]]></dc:creator><pubDate>Sat, 14 Dec 2024 16:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Sat, 14 Dec 2024 16:09:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul53" aria-label="Profile: paul53">@<bdi>paul53</bdi></a></p>
<p dir="auto">Das ist ja "doof".</p>
<p dir="auto">Bleibt also nur ein normales JS?</p>
]]></description><link>https://forum.iobroker.net/post/1228970</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228970</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Sat, 14 Dec 2024 16:09:33 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Sat, 14 Dec 2024 16:09:55 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte: Das undefined ist der Debug im Blockly.</p>
<p dir="auto">Man kann aus einer Callback-Funktion kein Ergebnis an das Hauptprogramm übergeben. Das Hauptprogramm ist beendet, bevor die Callback-Funktion ausgeführt wird.</p>
<p dir="auto">Übrigens ist das Modul "fs" Bestandteil von Node.js und muss nicht installiert werden.</p>
]]></description><link>https://forum.iobroker.net/post/1228968</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228968</guid><dc:creator><![CDATA[paul53]]></dc:creator><pubDate>Sat, 14 Dec 2024 16:09:55 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Sat, 14 Dec 2024 07:05:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a></p>
<p dir="auto">Done</p>
<p dir="auto">Edit<br />
Noch einen Fehler gefunden.<br />
Die Antwort kommt garnicht aus meinem Debug aus Blockly, sondern aus dem Script direkt.<br />
Das undefined ist der Debug im Blockly.</p>
<p dir="auto">Wie gebe ich die Antwort in das result bzw den return für den JS-Baustein? Evtl kann <a class="plugin-mentions-user plugin-mentions-a" href="/user/paul53" aria-label="Profile: paul53">@<bdi>paul53</bdi></a> mir das grad sagen. Du hast irgendwann mal gesagt, dass du blockly nicht nutzt ^^.</p>
]]></description><link>https://forum.iobroker.net/post/1228536</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228536</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Sat, 14 Dec 2024 07:05:14 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 13:15:05 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte in <a href="/post/1228532">Bilder mittels LLM analysieren</a>:</p>
<blockquote>
<p dir="auto">Eine Idee wo das undefined her kommt?</p>
</blockquote>
<p dir="auto">es sieht nach einer console.log Ausgabe aus.<br />
Ergänze mal deinen Lösungspost nochmal mit dem kompletten Javascript was im funktionsblock enthalten ist</p>
]]></description><link>https://forum.iobroker.net/post/1228534</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228534</guid><dc:creator><![CDATA[OliverIO]]></dc:creator><pubDate>Fri, 13 Dec 2024 13:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 13:19:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a></p>
<p dir="auto">Hier mein fertiges Blockly für interessierte:</p>
<p dir="auto"><img src="/assets/uploads/files/1734095082760-833ca05b-bebd-4765-a4a3-f476e7b0a1a5-image.png" alt="833ca05b-bebd-4765-a4a3-f476e7b0a1a5-image.png" class="img-markdown  img-fluid" /></p>
<p dir="auto"></p><section class="spoiler-wrapper"><button class="spoiler-control btn btn-default">Blockly</button><section style="display:none" class="spoiler-content"><p></p>
<pre><code>&lt;xml xmlns="https://developers.google.com/blockly/xml"&gt;
 &lt;variables&gt;
   &lt;variable id="#^~=}RQE~[:hE?sXCoB$"&gt;Bildpfad&lt;/variable&gt;
   &lt;variable id="o2iepdh*h(;FbS4Z=9{J"&gt;api_key&lt;/variable&gt;
   &lt;variable id="Uh*o[9LxAdT1B2TiZdAr"&gt;Frage&lt;/variable&gt;
 &lt;/variables&gt;
 &lt;block type="procedures_defcustomreturn" id="k1J9z=^XFMFehGb%0.og" x="-663" y="-688"&gt;
   &lt;mutation statements="false"&gt;
     &lt;arg name="Bildpfad" varid="#^~=}RQE~[:hE?sXCoB$"&gt;&lt;/arg&gt;
     &lt;arg name="api_key" varid="o2iepdh*h(;FbS4Z=9{J"&gt;&lt;/arg&gt;
     &lt;arg name="Frage" varid="Uh*o[9LxAdT1B2TiZdAr"&gt;&lt;/arg&gt;
   &lt;/mutation&gt;
   &lt;field name="NAME"&gt;Bild_Analysieren&lt;/field&gt;
   &lt;field name="SCRIPT"&gt;Y29uc3QgZnMgPSByZXF1aXJlKCdmcycpOw0KY29uc3QgT3BlbkFJID0gcmVxdWlyZSgnb3BlbmFpJyk7DQoNCi8vIFZhcmlhYmxlbiBmw7xyIEFQSS1LZXksIEJpbGRwZmFkIHVuZCBGcmFnZQ0KY29uc3QgQVBJX0tFWSA9IGFwaV9rZXk7DQpjb25zdCBJTUFHRV9QQVRIID0gQmlsZHBmYWQ7DQpjb25zdCBRVUVTVElPTiA9IEZyYWdlOw0KDQovL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gICAgICAgICAgew0KICAgICAgICAgICAgICB0eXBlOiAnaW1hZ2VfdXJsJywNCiAgICAgICAgICAgICAgaW1hZ2VfdXJsOiB7DQogICAgICAgICAgICAgICAgdXJsOiBgZGF0YTppbWFnZS9qcGVnO2Jhc2U2NCwke2Jhc2U2NEltYWdlfWAsDQogICAgICAgICAgICAgIH0sDQogICAgICAgICAgICB9LA0KICAgICAgICAgIF0sDQogICAgICAgIH0sDQogICAgICBdLA0KICAgIH0pOw0KDQogICAgLy8gTnVyIGRlbiBjb250ZW50IGF1cyBkZXIgQW50d29ydCB6dXLDvGNrZ2ViZW4NCiAgICByZXR1cm4gcmVzcG9uc2UuY2hvaWNlc1swXS5tZXNzYWdlLmNvbnRlbnQ7DQogIH0gY2F0Y2ggKGVycm9yKSB7DQogICAgY29uc29sZS5lcnJvcignRXJyb3I6JywgZXJyb3IpOw0KICB9DQp9DQoNCi8vIEZ1bmt0aW9uIGF1c2bDvGhyZW4NCmFuYWx5emVJbWFnZSgpLnRoZW4oKHJlc3VsdCkgPT4gew0KICBjb25zb2xlLmxvZyhyZXN1bHQpOw0KfSk7DQo=&lt;/field&gt;
   &lt;comment pinned="false" h="80" w="160"&gt;Beschreibe diese Funktion …&lt;/comment&gt;
 &lt;/block&gt;
 &lt;block type="http_get" id="%@DtL{e5a7xB/z4QWJJD" x="-662" y="-637"&gt;
   &lt;field name="TIMEOUT"&gt;2000&lt;/field&gt;
   &lt;field name="UNIT"&gt;ms&lt;/field&gt;
   &lt;field name="TYPE"&gt;arraybuffer&lt;/field&gt;
   &lt;value name="URL"&gt;
     &lt;shadow type="text" id="KylM(z%z`LA/%XK_x^*D"&gt;
       &lt;field name="TEXT"&gt;http://192.168.99.93/cgi-bin/api.cgi?cmd=Snap&amp;amp;channel=0&amp;amp;user=admin&amp;amp;password=abcd&lt;/field&gt;
     &lt;/shadow&gt;
   &lt;/value&gt;
   &lt;statement name="STATEMENT"&gt;
     &lt;block type="debug" id="d:IY2pT_WNG/EqsBccvX"&gt;
       &lt;field name="Severity"&gt;info&lt;/field&gt;
       &lt;value name="TEXT"&gt;
         &lt;shadow type="text" id="+Kg)Y%9AYp}{tY^/Vv|_"&gt;
           &lt;field name="TEXT"&gt;test&lt;/field&gt;
         &lt;/shadow&gt;
         &lt;block type="procedures_callcustomreturn" id="Th(%,~XXrnkE8m#b)/9D"&gt;
           &lt;mutation name="Bild_Analysieren"&gt;
             &lt;arg name="Bildpfad"&gt;&lt;/arg&gt;
             &lt;arg name="api_key"&gt;&lt;/arg&gt;
             &lt;arg name="Frage"&gt;&lt;/arg&gt;
           &lt;/mutation&gt;
           &lt;value name="ARG0"&gt;
             &lt;block type="http_response_tofile" id="w[MNq!R0Lr|-N$Go+E@L"&gt;
               &lt;value name="FILENAME"&gt;
                 &lt;shadow type="text" id="#5YFt*N{B7dOcv]kFRP$"&gt;
                   &lt;field name="TEXT"&gt;eingang.jpg&lt;/field&gt;
                 &lt;/shadow&gt;
               &lt;/value&gt;
             &lt;/block&gt;
           &lt;/value&gt;
           &lt;value name="ARG1"&gt;
             &lt;block type="text" id="qD1A7?Y)DhcB{4-ff0T="&gt;
               &lt;field name="TEXT"&gt;xyz&lt;/field&gt;
             &lt;/block&gt;
           &lt;/value&gt;
           &lt;value name="ARG2"&gt;
             &lt;block type="text" id="DjqZIXmZJ[JX-JqvE=/4"&gt;
               &lt;field name="TEXT"&gt;Was ist das für ein Foto?&lt;/field&gt;
             &lt;/block&gt;
           &lt;/value&gt;
         &lt;/block&gt;
       &lt;/value&gt;
     &lt;/block&gt;
   &lt;/statement&gt;
 &lt;/block&gt;
&lt;/xml&gt;
</code></pre>
<p dir="auto"></p></section></section><p></p>
<p dir="auto"></p><section class="spoiler-wrapper"><button class="spoiler-control btn btn-default">JS der Funktion</button><section style="display:none" class="spoiler-content"><p></p>
<pre><code>const fs = require('fs');
const OpenAI = require('openai');

// Variablen für API-Key, Bildpfad und Frage
const API_KEY = api_key;
const IMAGE_PATH = Bildpfad;
const QUESTION = Frage;

// OpenAI-Client initialisieren
const client = new OpenAI({
 apiKey: API_KEY, // Verwende die Variable für den API-Schlüssel
});

// Funktion zum Kodieren des Bildes in Base64
function encodeImage(imagePath) {
 const imageBuffer = fs.readFileSync(imagePath);
 return imageBuffer.toString('base64');
}

// Base64-String des Bildes erstellen
const base64Image = encodeImage(IMAGE_PATH); // Verwende die Variable für den Bildpfad

// Anfrage an OpenAI senden
async function analyzeImage() {
 try {
   const response = await client.chat.completions.create({
     model: 'gpt-4o-mini',
     messages: [
       {
         role: 'user',
         content: [
           {
             type: 'text',
             text: QUESTION, // Verwende die Variable für die Frage
           },
           {
             type: 'image_url',
             image_url: {
               url: `data:image/jpeg;base64,${base64Image}`,
             },
           },
         ],
       },
     ],
   });

   // Nur den content aus der Antwort zurückgeben
   return response.choices[0].message.content;
 } catch (error) {
   console.error('Error:', error);
 }
}

// Funktion ausführen
analyzeImage().then((result) =&gt; {
 console.log(result);
});

</code></pre>
<p dir="auto"></p></section></section><p></p>
<p dir="auto">In der Javascriptinstant noch folgende 2 Module hinzufügen.<br />
<img src="/assets/uploads/files/1734095420798-c9090244-d9a4-41f9-b896-680411412654-image.png" alt="c9090244-d9a4-41f9-b896-680411412654-image.png" class="img-markdown  img-fluid" /></p>
<pre><code>javascript.0	14:07:17.248	info	Start JavaScript script.js.Eigene_Scripte.Tests.Foto_KI_Test (Blockly)
javascript.0	14:07:17.269	info	script.js.Eigene_Scripte.Tests.Foto_KI_Test: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
javascript.0	14:07:17.837	info	script.js.Eigene_Scripte.Tests.Foto_KI_Test: undefined
javascript.0	14:07:21.943	info	script.js.Eigene_Scripte.Tests.Foto_KI_Test: Das Foto zeigt eine Straßenansicht, aufgenommen aus einem Fenster. Man sieht mehrere Häuser, eine kurvenreiche Straße und einige Bäume im Hintergrund. Der Himmel ist bewölkt und es scheint, als wäre es tagsüber. Die Sicht ist etwas trüb, wahrscheinlich aufgrund von Wetterbedingungen oder Schmutz auf dem Fenster.
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: OliverIO">@<bdi>OliverIO</bdi></a><br />
Eine Idee wo das undefined her kommt?</p>
]]></description><link>https://forum.iobroker.net/post/1228532</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228532</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Fri, 13 Dec 2024 13:19:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 12:32:25 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte in <a href="/post/1228505">Bilder mittels LLM analysieren</a>:</p>
<blockquote>
<p dir="auto">analyzeImage();</p>
</blockquote>
<p dir="auto">ja das geht auch, es hätte gereicht:</p>
<pre><code>let result=await analyzeImage();
console.log(result);
</code></pre>
<p dir="auto">hinzuschreiben.<br />
analyzeImage ist eine asynchrone Funktion.<br />
daher gibt sie eigentlich nur ein promise-objekt zurück, welches irgendwann in der Zukunft aufgelöst wird.</p>
<p dir="auto">mit await wartet dann javascript darauf bis das aufgelöst wird und gibt das ergebnis dann weiter falls da was zugewiesen ist<br />
ohne await geht es gleich weiter auch wenn die funktion noch nicht abgearbeitet wurde.</p>
]]></description><link>https://forum.iobroker.net/post/1228515</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228515</guid><dc:creator><![CDATA[OliverIO]]></dc:creator><pubDate>Fri, 13 Dec 2024 12:32:25 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 12:22:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a></p>
<p dir="auto">Habe schonmal einen Anfang:</p>
<p dir="auto"><img src="/assets/uploads/files/1734092009386-7c0ac640-4ce1-4e4d-aabe-336f995fbab4-image.png" alt="7c0ac640-4ce1-4e4d-aabe-336f995fbab4-image.png" class="img-markdown  img-fluid" /></p>
<p dir="auto">Die Funktion:</p>
<pre><code>const fs = require('fs');
const OpenAI = require('openai');

// Variablen für API-Key, Bildpfad und Frage
const API_KEY = api;
const IMAGE_PATH = bildpfad;
const QUESTION = frage;

// OpenAI-Client initialisieren
const client = new OpenAI({
  apiKey: API_KEY, // Verwende die Variable für den API-Schlüssel
});

// Funktion zum Kodieren des Bildes in Base64
function encodeImage(imagePath) {
  const imageBuffer = fs.readFileSync(imagePath);
  return imageBuffer.toString('base64');
}

// Base64-String des Bildes erstellen
const base64Image = encodeImage(IMAGE_PATH); // Verwende die Variable für den Bildpfad

// Anfrage an OpenAI senden
async function analyzeImage() {
  try {
    const response = await client.chat.completions.create({
      model: 'gpt-4o-mini',
      messages: [
        {
          role: 'user',
          content: [
            {
              type: 'text',
              text: QUESTION, // Verwende die Variable für die Frage
            },
            {
              type: 'image_url',
              image_url: {
                url: `data:image/jpeg;base64,${base64Image}`,
              },
            },
          ],
        },
      ],
    });

    console.log(response.choices[0]);
  } catch (error) {
    console.error('Error:', error);
  }
}


// Funktion ausführen
analyzeImage();
return(response.choices[0]);
</code></pre>
<p dir="auto">Allerdings wird der Log noch zugemüllt, eine Antwort kommt aber:</p>
<pre><code>javascript.0	13:12:13.916	error	script.js.Eigene_Scripte.aitestbl: ReferenceError: response is not defined
javascript.0	13:12:13.916	error	at etwas_tun (script.js.Eigene_Scripte.aitestbl:61:5)
javascript.0	13:12:13.916	error	at script.js.Eigene_Scripte.aitestbl:66:21
javascript.0	13:12:13.916	error	at script.js.Eigene_Scripte.aitestbl:73:3
javascript.0	13:12:15.880	info	script.js.Eigene_Scripte.aitestbl: { index: 0, message: { role: 'assistant', content: 'Anhand der Bildzeitstempel ist es Tag. Es ist 13:29 Uhr, was auf den Nachmittag hinweist.', refusal: null }, logprobs: null, finish_reason: 'stop' }
</code></pre>
<p dir="auto">Nun zu meinen Fragen.</p>
<ul>
<li>Wie bekomme ich die Fehler weg?</li>
<li>Bekomme ich im JS aus der Antwort den contenet extrahiert?</li>
<li>Kann ich den Konenet dann in das result schreiben lassen?</li>
</ul>
<p dir="auto">EDIT<br />
habe glaube alles hinbekommen:</p>
<pre><code>const fs = require('fs');
const OpenAI = require('openai');

// Variablen für API-Key, Bildpfad und Frage
const API_KEY = api;
const IMAGE_PATH = bildpfad;
const QUESTION = frage;

// OpenAI-Client initialisieren
const client = new OpenAI({
  apiKey: API_KEY, // Verwende die Variable für den API-Schlüssel
});

// Funktion zum Kodieren des Bildes in Base64
function encodeImage(imagePath) {
  const imageBuffer = fs.readFileSync(imagePath);
  return imageBuffer.toString('base64');
}

// Base64-String des Bildes erstellen
const base64Image = encodeImage(IMAGE_PATH); // Verwende die Variable für den Bildpfad

// Anfrage an OpenAI senden
async function analyzeImage() {
  try {
    const response = await client.chat.completions.create({
      model: 'gpt-4o-mini',
      messages: [
        {
          role: 'user',
          content: [
            {
              type: 'text',
              text: QUESTION, // Verwende die Variable für die Frage
            },
            {
              type: 'image_url',
              image_url: {
                url: `data:image/jpeg;base64,${base64Image}`,
              },
            },
          ],
        },
      ],
    });

    // Nur den content aus der Antwort zurückgeben
    return response.choices[0].message.content;
  } catch (error) {
    console.error('Error:', error);
  }
}

// Funktion ausführen
analyzeImage().then((result) =&gt; {
  console.log(result);
});

</code></pre>
]]></description><link>https://forum.iobroker.net/post/1228505</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228505</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Fri, 13 Dec 2024 12:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 11:11:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a></p>
<p dir="auto">Dann schaue ich am Wochenende mal, ob ich das in JS  bekomme (mit ChatGPT, ich selber bin da eher unbeholfen...).</p>
<p dir="auto">Sonst melde ich mich nochmal.<br />
Falls jemand mit testen möchte, kann ich auch (persönlich dieser Person) zum testen den Api key geben.</p>
<p dir="auto">Kann mir ja hinterher einen neuen erstellen.</p>
<p dir="auto">Ich werde versuchen es in eine Blockly Funktion zu bekommen, in der ich das Bild als Pfad und die Frage übergeben kann.</p>
]]></description><link>https://forum.iobroker.net/post/1228483</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228483</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Fri, 13 Dec 2024 11:11:04 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 10:21:45 GMT]]></title><description><![CDATA[<p dir="auto">@david-g</p>
<p dir="auto">1<br />
Wenn du es in den prompt reinschreibst dann kannst du ihn auch auf deutsch antworten lassen</p>
<p dir="auto">2<br />
Die Differenz ist wohl die Mehrwertsteuer</p>
<p dir="auto">3<br />
Ja Bild muss base64 kodiert werden. Beispiel ist ja mit enthalten.. Die Code Beispiele sind zwar alle in Python, können aber auch alle in Java Skript umgesetzt werden.<br />
so Übersetzung dann einfach wieder ChatGpt verwenden</p>
<p dir="auto">für eher was lokales kannst du mal hier schauen<br />
Das ist eine der bekanntesten Bibliotheken für Face and object recognition.<br />
Das funktioniert auch nur mit CPU und muss nicht unbedingt gleich eine Höllen-Grafikkarte<br />
mit verfügbar sein.<br />
<a href="https://github.com/opencv/opencv" rel="nofollow ugc">https://github.com/opencv/opencv</a></p>
]]></description><link>https://forum.iobroker.net/post/1228453</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228453</guid><dc:creator><![CDATA[OliverIO]]></dc:creator><pubDate>Fri, 13 Dec 2024 10:21:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Fri, 13 Dec 2024 07:17:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a> sagte in <a href="/post/1228347">Bilder mittels LLM analysieren</a>:</p>
<blockquote>
<p dir="auto">Ich glaube die toolbox kann keine Images.<br />
Aber du suchst die Vision api von OpenAI<br />
<a href="https://platform.openai.com/docs/guides/vision" rel="nofollow ugc">https://platform.openai.com/docs/guides/vision</a></p>
</blockquote>
<p dir="auto">Vielen Dank für den Link.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oliverio" aria-label="Profile: oliverio">@<bdi>oliverio</bdi></a> sagte in <a href="/post/1228347">Bilder mittels LLM analysieren</a>:</p>
<blockquote>
<p dir="auto">Wenn du den Anwendungsbereich hier beschreibst evtl gibt es eine Alternative</p>
</blockquote>
<p dir="auto">Ehrlich gesagt gibt es keinen echten Einsatzzweck. Eigentlich eher Spielerei weil ich es ganz cool finde ^^. Wäre für Snapshot oder Überwachungskamera.<br />
Steht dies oder das Auto am Hof, hat gtad Sohn oder Tochter geklingelt oder sonst was.</p>
<p dir="auto">EDIT</p>
<p dir="auto">Mit</p>
<pre><code>curl -X POST https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":[{"type":"text","text":"What’s in this image?"},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"}}]}],"max_tokens":300}'
</code></pre>
<p dir="auto">Bekomme ich schonmal eine Antwort.</p>
<pre><code>iobroker@iobroker:~$ curl -X POST https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxx" -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":[{"type":"text","text":"What’s in this image?"},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"}}]}],"max_tokens":300}'
{
  "id": "chatcmpl-Adtxq59etyGJ5zwGWLAhaGda1vWD1",
  "object": "chat.completion",
  "created": 1734073282,
  "model": "gpt-4o-mini-2024-07-18",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows a wooden pathway running through a lush, green meadow or wetland area. The path is bordered by tall grasses and some shrubs, with a clear blue sky above filled with soft clouds. The scene evokes a peaceful, natural landscape.",
        "refusal": null
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 36848,
    "completion_tokens": 49,
    "total_tokens": 36897,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "system_fingerprint": "fp_39a40c96a0"
}
iobroker@iobroker:~$
</code></pre>
<p dir="auto">Die Frage ist, ob ich ein Bild hochladen kann oder es vorher in base64 wandeln muss.</p>
<p dir="auto">Beim Beispiel wird Base64 verwendet.</p>
<p dir="auto">EDIT 2:<br />
Dke Abfrage von oben hat 1ct gekostet.<br />
Blöd ist eher, dass die Kreditkarte mit $5.95 belastet wurde obwohl ich nur $5.00 aufgeladen hab...</p>
]]></description><link>https://forum.iobroker.net/post/1228361</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228361</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Fri, 13 Dec 2024 07:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Thu, 12 Dec 2024 23:29:08 GMT]]></title><description><![CDATA[<p dir="auto">@david-g</p>
<p dir="auto">Ich glaube die toolbox kann keine Images.<br />
Aber du suchst die Vision api von OpenAI<br />
<a href="https://platform.openai.com/docs/guides/vision" rel="nofollow ugc">https://platform.openai.com/docs/guides/vision</a></p>
<p dir="auto">Die kann genau das.</p>
<p dir="auto">Preisgünstig ist es allerdings nicht. Das Bild allein kostet so zwischen 500 und 1000 tokens.<br />
Der normale bezahlbar reicht nicht. Man muss separat Geld für die api aufladen<br />
Für gelegentliche. Bildanalyse ok,<br />
Aber kontinuierliches scannen kostet dann.</p>
<p dir="auto">Wenn du den Anwendungsbereich hier beschreibst evtl gibt es eine Alternative</p>
]]></description><link>https://forum.iobroker.net/post/1228347</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228347</guid><dc:creator><![CDATA[OliverIO]]></dc:creator><pubDate>Thu, 12 Dec 2024 23:29:08 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Thu, 12 Dec 2024 19:25:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homoran" aria-label="Profile: homoran">@<bdi>homoran</bdi></a></p>
<p dir="auto">Oh, das hab ich garnicht mitbekommen.<br />
Schaue ich mir mal an.</p>
<p dir="auto">Mal sehen, ob das mit Bildern umgehen kann.</p>
]]></description><link>https://forum.iobroker.net/post/1228249</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228249</guid><dc:creator><![CDATA[David G.]]></dc:creator><pubDate>Thu, 12 Dec 2024 19:25:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bilder mittels LLM ChatGPT Vision ananalysieren on Thu, 12 Dec 2024 19:17:21 GMT]]></title><description><![CDATA[<p dir="auto">@david-g sagte in <a href="/post/1228244">Bilder mittels LLM analysieren</a>:</p>
<blockquote>
<p dir="auto">Zu einer Api von OpenAI finde ich nichts....</p>
</blockquote>
<p dir="auto">passt das?<br />
<a href="https://forum.iobroker.net/post/1226713">https://forum.iobroker.net/post/1226713</a></p>
]]></description><link>https://forum.iobroker.net/post/1228246</link><guid isPermaLink="true">https://forum.iobroker.net/post/1228246</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Thu, 12 Dec 2024 19:17:21 GMT</pubDate></item></channel></rss>