<?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[Probleme mit JS 6.0.3?]]></title><description><![CDATA[<p dir="auto">Hallo zusammen,</p>
<p dir="auto">ich hab seit ein paar Wochen ein Script das einen HM Aktor schalten sollte, aber es nicht mehr macht. Das script ist alt und lief bisher Problemlos.<br />
Da es mir nicht so wichtig war habe ich mich nicht Ausführlich beschäftigt.<br />
Seltsam ist das es dann ohne erkennbaren Grund 2 oder 3 Tage wie gewohnt funktiniert hat.</p>
<p dir="auto">Jetzt ist mir aufgefallen das auch ein anderes, ebenfalls älteres und deutlich einfacheres Script nicht wie erwartet funktioniert.<br />
Hier konnte ich auch ganz Eindeutig die stelle identifizieren an der es klemmt.<br />
Es wird eine Lampe eingeschaltet (bis dahin funktioniert es) und soll dann über einen Timeout ausgeschaltet werden.<br />
Eben jener Timeout wird dann nicht mehr ausgeführt.</p>
<p dir="auto">Konnte jemand mit dieser Version ähnliche Probleme beobachten?</p>
<p dir="auto">Edit: Jetzt hab ich Testhalber das Licht Skript nochmal neu gestartet und das scheint das Problem fürs erste behoben zu haben. Da der ioBroker heute bereits einmal neu gestartet wurde, scheint das aber keine Dauerhafte Lösung zu sein.</p>
<p dir="auto">Da die Frage nach den Skripten ohnehin kommt, hier sind sie:<br />
Skript 1:</p>
<pre><code>// Musik im Bad
const box = 'sonos.0.root.192_168_0_15';
const lm = 'hm-rpc.0.LEQ1275892';
const bwm = 'hm-rpc.0.NEQ0963820.3.MOTION';
const t1 = 'hm-rpc.0.NEQ0963820';
const t2 = 'enocean.0.0029b16c';
const start = '06:00:00';
const end = '23:00:00';
const vol = 10;
const step = 2;
const defStation = 'Bayern 3';

let mode = 'auto'; //modis: auto = Vollautomatisch, semi = nur Pause/Stop erfolgt Automatisch, manu = nur Handbedienung 
let modeChange;

schedule('{"time":{"exactTime":true,"start":"23:00"},"period":{"days":1}}', function(){
    setState(box + '.stop', true);
    setTimeout(function(){
         setState(lm + '.1.STATE', false);
    }, 10000);
   
})

//Play &amp; Pause/Stop
on({id: bwm},
    function(obj){
        //log('Bewegung im Bad, Musik einschalten')
        if(obj.state.val === true &amp;&amp; mode === 'auto' &amp;&amp; cTime() &amp;&amp; getState(box + '.state').val !== 'play' &amp;&amp; getState(box + '.alive').val === true){
            play();
        }else if(obj.state.val === false){
            setTimeout(function(){
                if(getState(bwm).val === false){
                    setState(box + '.pause', true);
                }
            }, 60000);
            
        }
    });

on({id: [t1 + '.1.PRESS_LONG', t2 + '.A0']}, 
    function(obj){
        if(obj.state.val === false){

        }else{
            //log('Taste 1 Lange gedrückt');
            let state = getState(box + '.state').val;
            //log(state);
            if(state === 'play'){
                setState(box + '.stop', true);
                mode = 'semi';
                modeChange = setTimeout(function(){
                    mode = 'auto';
                }, 3600*1000);
            }else if(state === 'stop' || state === 'pause'){
                setState(box + '.play', true);
                
            }
        }
})

function cTime(){
    let check = isTimeInRange(start, end);
    return check;
}

function play(station){
    if(station === undefined || station === null){
        station = defStation;
    }
    let power = cPower();
    setState(box + '.volume', vol);
    setState(box + '.favorites_set', station);
    setState(box + '.play', true);
}

function cPower(){
    let power = getState(lm + '.1.STATE').val;
    if(power === false){
        setState(lm + '.1.STATE', true);
        log('Schalte Sonos Box im Bad ein');
        setTimeout(function(){
            return true;
        }, 60000);
    }
}

//Lautstärke leiser
on({id: [t1 + '.1.PRESS_SHORT', t2 + '.B0']},
    function(){
        let a_vol = getState(box + '.volume').val;
        setState(box + '.volume', a_vol - step);
    })
//Lautstärke lauter
on({id: [t1 + '.2.PRESS_SHORT', t2 + '.BI']},
    function(){
        let a_vol = getState(box + '.volume').val;
        setState(box + '.volume', a_vol + step);
    })

//Senderwechsel zufall
on({id: [t1 + '.2.PRESS_LONG', t2 + '.AI']},
    function(obj){
        if(obj.state.val === false){

        }else{
            let favs = getState(box + '.favorites_list').val;
            favs = favs.split(',');
            let nr = favs.length;
            let a_station = getState(box + '.favorites_set').val;
            let rnr = random(nr);

            if(!favs){ return; }

            if(favs[rnr] !== a_station){
                setState(box + '.favorites_set', favs[rnr].replace(/^\s/g, ''));
            }else{
                rnr = random(nr);
                setState(box + '.favorites_set', favs[rnr].replace(/^\s/g, ''));
            }
        }
    })

//TODO: Erkennung wenn mit App gesteuert wurde

function random(max){
    return Math.round(Math.random()*Math.floor(max));
}
</code></pre>
<p dir="auto">Skript 2:</p>
<pre><code>const bwmVorne = 'enocean.0.018537e7.PIRS';
const bwmTreppenhaus = 'hm-rpc.0.JEQ0156276.1.MOTION';
const licht = 'hm-rpc.0.JEQ0094999.1.STATE';
const brightness = 'enocean.0.04210aa2.ILL';

let timeout2, brightnessThreshold = 1;

//Licht schalten bei Bewegung
on({id: bwmVorne},
    (obj) =&gt; {
        //log('Bewegung im vorderen Flur');
        if(timeout2){
            clearTimeout(timeout2);
        }
        // if(obj.state.val === true &amp;&amp; isTimeInRange(von, bis) === true){
        if(obj.state.val === true &amp;&amp; getState(brightness).val &lt; brightnessThreshold){
             
             setState(licht, true)
             timeout2 = setTimeout(function(){
                setState(licht, false); 
                //log('Flur vorne Licht AUS');
                }, 180 * 1000)
         }else if(obj.state.val === false){
            //log('Flur vorne Licht AUS');
            setState(licht, false);
        }
    })

</code></pre>
<p dir="auto">System:</p>
<pre><code>*** BASISSYSTEM ***
CPU-Architektur: x86_64
Docker: Nein
LXC: kvm
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

Systemuptime und Load:
 21:45:42 up 44 days, 10:38,  1 user,  load average: 0,17, 0,24, 0,25
CPU threads: 8

*** Zeit und Zeitzonen ***
Mi 2. Nov 20:45:42 UTC 2022
Mi 2. Nov 21:45:42 CET 2022
CET +0100
Europe/Berlin

*** User und Gruppen ***
jey-cee
/home/jey-cee
jey-cee adm cdrom sudo dip plugdev lxd iobroker

*** ARBEITSSPEICHER ***
               total        used        free      shared  buff/cache   available
Mem:           5,8Gi       2,5Gi       1,3Gi       1,0Mi       2,0Gi       3,0Gi
Swap:          4,0Gi       0,0Ki       4,0Gi
Total:         9,8Gi       2,5Gi       5,3Gi

*** DATEISYSTEM ***
Filesystem                        Type   Size  Used Avail Use% Mounted on
tmpfs                             tmpfs  594M  1,2M  593M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4    31G   13G   17G  44% /
tmpfs                             tmpfs  2,9G     0  2,9G   0% /dev/shm
tmpfs                             tmpfs  5,0M     0  5,0M   0% /run/lock
/dev/sda2                         ext4   2,0G  247M  1,6G  14% /boot
tmpfs                             tmpfs  594M  4,0K  594M   1% /run/user/1000

*** Nodejs-Installation ***
[sudo] password for jey-cee: 
/usr/bin/nodejs         v14.20.1
/usr/bin/node           v14.20.1
/usr/bin/npm            6.14.17

nodejs:
  Installiert:           14.20.1-deb-1nodesource1
  Installationskandidat: 14.20.1-deb-1nodesource1
  Versionstabelle:
 *** 14.20.1-deb-1nodesource1 500
        500 https://deb.nodesource.com/node_14.x jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     12.22.9~dfsg-1ubuntu3 500
        500 http://bd.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

*** ioBroker-Installation ***
js-controller:  4.0.23
Admin-Adapter:  6.2.23

Repos und Updates:
stable        : http://download.iobroker.net/sources-dist.json
beta          : http://download.iobroker.net/sources-dist-latest.json

Active repo(s): beta

Used repository: beta
Adapter    "backitup"     : 2.5.4    , installed 2.5.2  [Updatable]
Adapter    "xbox"         : 1.0.1    , installed 1.0.0  [Updatable]

Es wird die Zahl der Objekte und Zustände ermittelt - Dies kann etwas dauern.
Zahl der Objekte:       23087
Zahl der Zustände:      16259

*** X-Server-Setup ***
X-Server: Nein
Desktop: 
Konsole: tty

*** Repositories und OS-Updates ***
OK:1 https://deb.nodesource.com/node_14.x jammy InRelease
OK:2 http://bd.archive.ubuntu.com/ubuntu jammy InRelease
OK:3 http://bd.archive.ubuntu.com/ubuntu jammy-updates InRelease
OK:4 http://bd.archive.ubuntu.com/ubuntu jammy-backports InRelease
OK:5 http://bd.archive.ubuntu.com/ubuntu jammy-security InRelease
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Aktualisierung für 3 Pakete verfügbar. Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.

*** Lauschende Server-Ports ***
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      0          15613      1/systemd           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          389163822  1912892/sshd: /usr/ 
tcp        0      0 0.0.0.0:2010            0.0.0.0:*               LISTEN      1001       389165460  1913113/io.hm-rpc.1 
tcp        0      0 0.0.0.0:6052            0.0.0.0:*               LISTEN      1001       389167749  1913427/python3     
tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      1001       389167284  1913143/io.mqtt.0   
tcp        0      0 0.0.0.0:1884            0.0.0.0:*               LISTEN      1001       389167285  1913143/io.mqtt.0   
tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN      1001       389166359  1912921/iobroker.js 
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1001       389163893  1912921/iobroker.js 
tcp        0      0 0.0.0.0:12001           0.0.0.0:*               LISTEN      1001       389165447  1913083/io.hm-rpc.0 
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      102        389147488  1900012/systemd-res 
tcp6       0      0 :::111                  :::*                    LISTEN      0          1153       1/systemd           
tcp6       0      0 :::22                   :::*                    LISTEN      0          389163824  1912892/sshd: /usr/ 
tcp6       0      0 :::8081                 :::*                    LISTEN      1001       389163969  1912975/io.admin.0  
tcp6       0      0 :::8082                 :::*                    LISTEN      1001       389166584  1913235/io.web.0    
tcp6       0      0 :::8098                 :::*                    LISTEN      1001       389166595  1913203/iobroker.js 
tcp6       0      0 :::8000                 :::*                    LISTEN      1001       389171449  1913340/io.upnp.0   
tcp6       0      0 :::3501                 :::*                    LISTEN      1001       389579916  1913188/io.sonos.0  
tcp6       0      0 :::3500                 :::*                    LISTEN      1001       389167337  1913188/io.sonos.0  

</code></pre>
]]></description><link>https://forum.iobroker.net/topic/59606/probleme-mit-js-6-0-3</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 02:25:03 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/59606.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Nov 2022 20:47:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit JS 6.0.3? on Thu, 03 Nov 2022 06:34:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jey-cee" aria-label="Profile: jey-cee">@<bdi>jey-cee</bdi></a> sagte in <a href="/post/884643">Probleme mit JS 6.0.3?</a>:</p>
<blockquote>
<p dir="auto">Es wird eine Lampe eingeschaltet (bis dahin funktioniert es) und soll dann über einen Timeout ausgeschaltet werden.<br />
Eben jener Timeout wird dann nicht mehr ausgeführt.</p>
</blockquote>
<p dir="auto">hmm..so scripte hab ich auch.. aber nöö keine Probleme damit. bist du dir sicher dass es an dem timeout liegt..und nicht an dem trigger ? hatt ich auch mal.. im anderen Script licht zusätzlich eingeschaltet und ich wundere mich dass der timeout nicht greift</p>
<p dir="auto">bau paar log Ausgaben ein..</p>
]]></description><link>https://forum.iobroker.net/post/884784</link><guid isPermaLink="true">https://forum.iobroker.net/post/884784</guid><dc:creator><![CDATA[arteck]]></dc:creator><pubDate>Thu, 03 Nov 2022 06:34:31 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit JS 6.0.3? on Wed, 02 Nov 2022 21:21:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomas-braun" aria-label="Profile: thomas-braun">@<bdi>thomas-braun</bdi></a> na muss man doch nutzen wenn es schon so ein geniales tool gibt 😉👍</p>
]]></description><link>https://forum.iobroker.net/post/884674</link><guid isPermaLink="true">https://forum.iobroker.net/post/884674</guid><dc:creator><![CDATA[Jey Cee]]></dc:creator><pubDate>Wed, 02 Nov 2022 21:21:55 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit JS 6.0.3? on Wed, 02 Nov 2022 21:17:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jey-cee" aria-label="Profile: jey-cee">@<bdi>jey-cee</bdi></a></p>
<p dir="auto">Zum Problem kann ich nix sagen, aber die Infos zum System sind toll!!!!  <img src="https://forum.iobroker.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60d.png?v=ba16ebd4856" class="not-responsive emoji emoji-android emoji--heart_eyes" style="height:23px;width:auto;vertical-align:middle" title=":heart_eyes:" alt="😍" /></p>
]]></description><link>https://forum.iobroker.net/post/884669</link><guid isPermaLink="true">https://forum.iobroker.net/post/884669</guid><dc:creator><![CDATA[Thomas Braun]]></dc:creator><pubDate>Wed, 02 Nov 2022 21:17:17 GMT</pubDate></item></channel></rss>