<?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[Scripting für ioBroker: Wenn dies, dann das best practicse?]]></title><description><![CDATA[<p dir="auto">Hallo liebes Forum,</p>
<p dir="auto">ich habe bislang mein Heim viel über IFTTT ohne iobroker konfiguriert. Nun bin wegen Alexa für Gira dank <a href="https://marc.tv/synology-iobroker-dank-node-red-mit-alexa-steuern/" rel="nofollow ugc">https://marc.tv/synology-iobroker-dank-node-red-mit-alexa-steuern/</a> bei ioBroker gelandet und würde gerne mehr direkt über den ioBroker machen.</p>
<p dir="auto">Was ist hier die best practice für Aufgaben wie "Wenn die Luftfeuchtigkeit über den Meross Sensor bei &gt; 90% liegt, mach bitte das Licht des Hue Adapters im Badezimmer rot und mache die Heizung von Homatic IP für 10 min auf max.</p>
<p dir="auto">Ich kann programmieren (Javascript und PHP), ich kenne NodeRed aber wie bilde ich solche Dinge ab? Gibt es da etwas eingebautes oder einen Scripting Adapeter im Kern von iObroker?</p>
]]></description><link>https://forum.iobroker.net/topic/37488/scripting-für-iobroker-wenn-dies-dann-das-best-practicse</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 06:24:50 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/37488.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Oct 2020 13:06:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 15:52:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> ok, geht doch. Nur ist da eine Verzögerung. Aber danke für die Hilfe! =) Ihr habt mir sehr geholfen!</p>
<p dir="auto">Hier das finale Script falls es jemand braucht. Wenn die Luftfeuchtigkeit im Bad über 90% ist (jemand duscht), Handtuchwärme an. Sonst aus.</p>
<pre><code>on('meross.0.1912184550583426280548e1e913c738.120027D1B3B3.latestHumidity', function (obj) {
    log(obj.state.val);
    if(obj.state.val &gt; 90) {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',35);
    } else {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',5);
    }
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/501006</link><guid isPermaLink="true">https://forum.iobroker.net/post/501006</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 15:52:25 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 15:42:01 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">ist in "common". Und ja, es ist aktiv. Und ich habe das Licht doch an und aus gemacht. Also müsste es sich doch verändern. Zumindest tut es das im Object Tree</p>
]]></description><link>https://forum.iobroker.net/post/501004</link><guid isPermaLink="true">https://forum.iobroker.net/post/501004</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 15:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 15:12:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a><br />
Der Wert des Datenpunktes mit der ID 'hue.0.Bett_rechts.on' muss sich erst ändern, damit getriggert wird.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte in <a href="/post/500972">Scripting für ioBroker: Wenn dies, dann das best practicse?</a>:</p>
<blockquote>
<p dir="auto">Das log bleibt leer.</p>
</blockquote>
<p dir="auto">Hast Du auch mal im Tab "Log" nachgeschaut ?<br />
Das Script hast Du aktiviert und hoffentlich nicht in der Gruppe "global" erstellt ?</p>
]]></description><link>https://forum.iobroker.net/post/500977</link><guid isPermaLink="true">https://forum.iobroker.net/post/500977</guid><dc:creator><![CDATA[paul53]]></dc:creator><pubDate>Fri, 09 Oct 2020 15:12:13 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 15: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 />
Geht leider nicht mit obj.state.val nicht. Ich habe ein Mini-Beispiel das ja gehen müsste. Wenn ich die rechte Lampe am Bett per Hue App oder Alexa ein- oder auzsschalte, muss doch das event feuern. Tut es aber nicht. Das log bleibt leer.</p>
<pre><code>on('hue.0.Bett_rechts.on', function (obj) {
  log(obj.state.val);
  log("Lichtstatus hat sich geändert!");
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/500972</link><guid isPermaLink="true">https://forum.iobroker.net/post/500972</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 15:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 15:00:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte:</p>
<blockquote>
<p dir="auto">if(obj.val &gt; 90) {</p>
</blockquote>
<p dir="auto">Ändere in</p>
<pre><code>    if(obj.state.val &gt; 90) {
</code></pre>
]]></description><link>https://forum.iobroker.net/post/500957</link><guid isPermaLink="true">https://forum.iobroker.net/post/500957</guid><dc:creator><![CDATA[paul53]]></dc:creator><pubDate>Fri, 09 Oct 2020 15:00:30 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 14:50:37 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> Brauche ich dann keinen cron mehr? Also wenn ich so was mache wie das hier wäre besser und nix mehr mit dem scheduler?</p>
<pre><code>on('meross.0.1912184550583426280548e1e913c738.120027D1B3B3.latestHumidity', function (obj) {
    
    if(obj.val &gt; 90) {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',35);
    } else {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',5);
    }
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/500941</link><guid isPermaLink="true">https://forum.iobroker.net/post/500941</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 14:44:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte in <a href="/post/500928">Scripting für ioBroker: Wenn dies, dann das best practicse?</a>:</p>
<blockquote>
<p dir="auto">So geht das, oder?</p>
</blockquote>
<p dir="auto">ich kann nur Blöcke schieben ;-)</p>
<p dir="auto">Du brauchst keinen schedule, in js gibt es etwas wie <code>on....</code><br />
damit prüfst du den Datenpunkt ob er sich ändert</p>
]]></description><link>https://forum.iobroker.net/post/500932</link><guid isPermaLink="true">https://forum.iobroker.net/post/500932</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:44:17 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 14:41:57 GMT]]></title><description><![CDATA[<p dir="auto">Ich war dumm. So geht das, oder?</p>
<pre><code>schedule('*/30 * * * * *', function () {
  getState('meross.0.1912184550583426280548e1e913c738.120027D1B3B3.latestHumidity', function (error, state) {
    log(state.val);
    if(state.val &gt; 90) {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',35);
    } else {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',5);
    }
});
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/500928</link><guid isPermaLink="true">https://forum.iobroker.net/post/500928</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:41:57 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 14:40:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte in <a href="/post/500926">Scripting für ioBroker: Wenn dies, dann das best practicse?</a>:</p>
<blockquote>
<p dir="auto">Denn ich habe ja nicht automatisch ein event wie "Wert ist größer als X" was geworfen wird</p>
</blockquote>
<p dir="auto">nicht direkt, aber dass bei dem Datenpunkt etwas geändert wird.<br />
Dann prüfen ob die Änderung im Vergleich zum alten Wert &gt;60 ist und gut ist</p>
]]></description><link>https://forum.iobroker.net/post/500927</link><guid isPermaLink="true">https://forum.iobroker.net/post/500927</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:40:58 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 14:38:30 GMT]]></title><description><![CDATA[<p dir="auto">Danke!</p>
<p dir="auto">Ich habe nun ein ganz simples Script geschrieben welches einen Wert eines Objektes überwacht um einen anderen zu setzen. Denn ich habe ja nicht automatisch ein event wie "Wert ist größer als X" was geworfen wird. Anders als bei einem Button.</p>
<p dir="auto">Das versuche ich nun alle 30 Sek auszuführen. Ich weiß nicht, ob es so klappt. Ich hätte erwartet, dass der Value alle 30 sekunden im iobroker log steht. Tut es nämlich nicht. Macht man das so oder kann/sollte ich das eleganter über "on" machen?</p>
<pre><code>'*/30 * * * * *'
getState('meross.0.1912184550583426280548e1e913c738.120027D1B3B3.latestHumidity', function (error, state) {
    console.log(state.val);
    if(state.val &gt; 90) {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',35);
    } else {
        setState('meross.0.1912184550583426280548e1e913c738.01009500.custom',5);
    }
});
</code></pre>
]]></description><link>https://forum.iobroker.net/post/500926</link><guid isPermaLink="true">https://forum.iobroker.net/post/500926</guid><dc:creator><![CDATA[Bravestarr]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:38:30 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 13:32:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> oder du siehst dir mal den smartcontrol adapter an.</p>
]]></description><link>https://forum.iobroker.net/post/500874</link><guid isPermaLink="true">https://forum.iobroker.net/post/500874</guid><dc:creator><![CDATA[da_Woody]]></dc:creator><pubDate>Fri, 09 Oct 2020 13:32:37 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 13:16:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte:</p>
<blockquote>
<p dir="auto">Ich kann programmieren (Javascript</p>
</blockquote>
<p dir="auto">Dann werden Dich die <a href="https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md" rel="nofollow ugc">Funktionen des Javascript-Adapters</a> interessieren.</p>
]]></description><link>https://forum.iobroker.net/post/500855</link><guid isPermaLink="true">https://forum.iobroker.net/post/500855</guid><dc:creator><![CDATA[paul53]]></dc:creator><pubDate>Fri, 09 Oct 2020 13:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting für ioBroker: Wenn dies, dann das best practicse? on Fri, 09 Oct 2020 13:09:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bravestarr" aria-label="Profile: Bravestarr">@<bdi>Bravestarr</bdi></a> sagte in <a href="/post/500846">Scripting für ioBroker: Wenn dies, dann das best practicse?</a>:</p>
<blockquote>
<p dir="auto">Gibt es da etwas eingebautes oder einen Scripting Adapeter</p>
</blockquote>
<p dir="auto">da gibt es denn javascript-Adapter (heißt jetzt script-Engine).</p>
<p dir="auto">Wahlweise in echtem js, oder für Einsteiger mit Blockly als "js-visual"</p>
]]></description><link>https://forum.iobroker.net/post/500847</link><guid isPermaLink="true">https://forum.iobroker.net/post/500847</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Fri, 09 Oct 2020 13:09:58 GMT</pubDate></item></channel></rss>