So...
iob diag
======================= SUMMARY =======================
v.2023-10-10
Static hostname: iobroker
Icon name: computer-vm
Chassis: vm
Virtualization: kvm
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.0-28-amd64
Architecture: x86-64
Installation: kvm
Kernel: x86_64
Userland: amd64
Timezone: Europe/Berlin (CET, +0100)
User-ID: 1000
X-Server: false
Boot Target: graphical.target
Pending OS-Updates: 0
Pending iob updates: 0
Nodejs-Installation: /usr/bin/nodejs v18.17.1
/usr/bin/node v18.17.1
/usr/bin/npm 9.6.7
/usr/bin/npx 9.6.7
/usr/bin/corepack 0.18.0
Recommended versions are nodejs 18.19.1 and npm 10.2.4
Your nodejs installation is correct
MEMORY:
total used free shared buff/cache available
Mem: 5.9G 1.9G 2.8G 0.0K 1.3G 3.8G
Swap: 2.0G 47M 2.0G
Total: 8.0G 1.9G 4.8G
Active iob-Instances: 21
Active repo(s): stable
ioBroker Core: js-controller 5.0.19
admin 6.13.16
ioBroker Status: iobroker is running on this host.
Objects type: jsonl
States type: redis
Status admin and web instance:
+ system.adapter.admin.0 : admin : iobroker - enabled, port: 8081, bind: 0.0.0.0, run as: admin
system.adapter.web.0 : web : iobroker - disabled, port: 8082, bind: 0.0.0.0, run as: admin
Objects: 12497
States: 6473
Size of iob-Database:
26M /opt/iobroker/iobroker-data/objects.jsonl
12M /opt/iobroker/iobroker-data/objects.json.migrated
12M /opt/iobroker/iobroker-data/objects.json.bak.migrated
13M /opt/iobroker/iobroker-data/states.jsonl
7.6M /opt/iobroker/iobroker-data/states.json.migrated
7.6M /opt/iobroker/iobroker-data/states.json.bak.migrated
=================== END OF SUMMARY ====================
sudo apt update
apt policy nodejs
iouser@iobroker:~$ sudo apt update
OK:1 http://security.debian.org/debian-security bullseye-security/updates InRelease
OK:2 http://ftp.gwdg.de/pub/linux/debian/debian bullseye InRelease
OK:3 http://deb.debian.org/debian bullseye-backports InRelease
OK:4 http://ftp.gwdg.de/pub/linux/debian/debian bullseye-updates InRelease
Holen:5 https://deb.nodesource.com/node_18.x bullseye InRelease [4.586 B]
Es wurden 4.586 B in 1 s geholt (8.092 B/s).
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Alle Pakete sind aktuell.
iouser@iobroker:~$ apt policy nodejs
nodejs:
Installiert: 18.17.1-deb-1nodesource1
Installationskandidat: 18.17.1-deb-1nodesource1
Versionstabelle:
*** 18.17.1-deb-1nodesource1 500
500 https://deb.nodesource.com/node_18.x bullseye/main amd64 Packages
100 /var/lib/dpkg/status
12.22.12~dfsg-1~deb11u4 500
500 http://ftp.gwdg.de/pub/linux/debian/debian bullseye/main amd64 Packages
500 http://security.debian.org/debian-security bullseye-security/updates/main amd64 Packages
Ich weiss zwar, warum du fragst, aber... Das Skript läuft ja! Darum geht es nicht. Es geht nur darum, dass es nicht wieder anläuft, sobald man es einmal stoppt. Sofern ich dann den iob komplett durchstarte, ist wieder alles gut.
// create some global vars
var run;
var reso;
var hdr;
var hdr_state = "true";
on({id:"denon.0.zoneMain.powerZone"}, function (obj) {
if (obj.state.val === true || obj.state.val === "true") {
log("Interval gestartet",'info');
run = setInterval(function() {
setHDRMode();
}, 15000);
} else {
log("Interval gestoppt",'info');
clearInterval(run)
}
});
function setHDRMode() {
const request = require('request');
var parseString = require('xml2js').parseString;
const options = {
url: 'https://marantz-sr5015.fritz.box:10443/ajax/general/get_config?type=12',
agentOptions: {
strictSSL: false,
rejectUnauthorized: false
}
};
request.get(options, function (error, response, body) {
if (error) log(error, 'error'); // Print the error if one occurred
//log('statusCode:'+ response && response.statusCode, 'debug'); // Print the response status code if a response was received
//log(body, 'debug');
parseString(body, function(err, result) {
//log(result, 'info');
reso = result.Information.Video[0].HDMISignalInfo[0].Resolution[0];
hdr = result.Information.Video[0].HDMISignalInfo[0].HDR[0];
log('Current resolution: ' + reso, 'debug');
log('Current HDR status: ' + hdr, 'debug');
// HDR off: ' --- -> --- '
// HDR on: 'HDR10 -> HDR10'
if (hdr.includes("HDR")) {
switchHDR("true");
} else {
switchHDR("false");
}
});
});
// HDR on: http://mediapc.fritz.box:8090/json-rpc?request=%7B%22command%22:%22componentstate%22,%22componentstate%22:%7B%22component%22:%22HDR%22,%22state%22:true%7D%7D
};
function switchHDR(mode) {
if (mode !== hdr_state ) {
try {
require("request")('http://mediapc.fritz.box:8090/json-rpc?request=%7B%22command%22:%22componentstate%22,%22componentstate%22:%7B%22component%22:%22HDR%22,%22state%22:'+mode+'%7D%7D').on("error", function (e) {console.error(e);});
hdr_state = mode;
log("Switched HDR mode to:"+hdr_state, 'info');
} catch (e) { console.error(e); }
}
};