NEWS
[Aufruf] Nina Gefahrenmeldung Adapter
-
(Edit 16.1.: Schedule eingebaut)
Die vielen Glatteiswarungen in dem letzten Tagen haben mich inspiriert, etwa Javascript zu üben.
Ziel war, eine Visualisierung bereitzustellen, die- mit mehreren Landkreisnummern klarkommt, sinnvoll für Pendler. Was ich hier bisher gesehen habe, hatte immer nur eine Nummer eingebrannt,
- die Meldungen abhängig von ihrer Anzahl darzustellen.
Das Skript bietet noch keine Robustheit, wenn z.B. die Anzahl der Datenpunkte von der Anzahl der tatsächlich aktiven Meldungen abweicht.
Auch hat es keinen Trigger...Als Trigger läuft es 5minütlich. Hier im Thread gibt es auch Beispiele, es an die Änderung der Anzahl der Meldungen zu binden, wobei zu überlegen ist, wie man alle Landkreise berücksichtigt.
Es schreibt am Ende in zwei User-Datenpunkte, die existieren müssen, der kurze ist für eine Überschrift gedacht, der andere aggregiert alle vorhandenen Meldungen in einen HTML-Block.
Das HTML lässt sich in der vis-2 mit einem Basic String (unescaped) darstellen, dieser unterstützt einen Scrollbar. Für diesen
CSS Allgemein -> overflow-y = visible.
Die HTML-Formatierung ist weiter ausbaufähig.schedule('3,8,13,18,23,28,33,38,43,48,53,58 * * * *', function(obj) { const landkreise = [11000, 12067]; const warnung_components = [ //'info01.headline', //handle headline separately 'info01.description', 'info01.instruction', 'source', 'msgType', 'info01.event', 'info01.severity', 'info01.category01', 'info01.certainty', 'info01.contact', 'sent', 'info01.effective', 'info01.expires', //'info01.fullText', broken values of "headline + description + instruction" but delivers NaNundefined 'info01.responseType01', 'info01.senderName', 'info01.urgency', 'info01.web' ]; var outstring = ''; var shortstring = ''; landkreise.forEach(lk => { var object_string = 'nina.0.' + lk; var number_warn = getState(object_string + '.'+ 'numberOfWarn').val //alternative: nina.0.11000.numberOfWarn var lk_name = getObject(object_string).common.name; outstring += ('<h2>\n'+ lk_name + ' hat ' + number_warn + ' Nina-Warnung/en.\n\n</h2>'); shortstring += ('<p>\n'+ lk_name + ': ' + number_warn + '\n</p>') if ((number_warn > 0) && (number_warn < 100)) { // more than 99 do not fit into naming scheme for (let i=1; i <= number_warn; i++) { outstring += ('<hr>'); var object_string_warn = object_string + '.' + 'warnung' + ("0" + i).slice(-2) outstring += ('<p>\n'+object_string_warn+'\n\n</p>'); outstring += ('<h3>\n'+(getState(object_string_warn+ '.info01.headline').val)+'\n\n</h3>'); warnung_components.forEach(wc => { outstring += ('<p><small>'+wc+':</small> '+(getState(object_string_warn+ '.' +wc).val) + '\n</p>').replace('info01.', ''); }); } outstring += ('<hr>'); } }); setState('0_userdata.0.visualisations.nina_aggregated_short', shortstring); setState('0_userdata.0.visualisations.nina_aggregated_warnings', outstring); //console.log(outstring); });
-
Hallo Zusammen,
habe mir den Adapter installiert und auch ein Upload gemacht. Dennoch will er bei mir nicht laufen. Bekomme beim start folgende Meldungen;
host.ioBroker 2026-01-14 08:06:01.949 error instance system.adapter.nina.0 terminated with code 1 (JS_CONTROLLER_STOPPED) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: Node.js v22.21.0 host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: } host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: ] host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/iobroker.nina/main.js' host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/iobroker.nina/node_modules/traverse/index.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/typedarray.prototype.slice/index.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/typedarray.prototype.slice/implementation.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/es-abstract/2024/TypedArraySpeciesCreate.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/es-abstract/2024/TypedArrayCreateFromConstructor.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/es-abstract/2024/IsTypedArrayOutOfBounds.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/typed-array-byte-offset/index.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/reflect.getprototypeof/polyfill.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/reflect.getprototypeof/implementation.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: '/opt/iobroker/node_modules/which-builtin-type/index.js', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: requireStack: [ host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: code: 'MODULE_NOT_FOUND', host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at Module._compile (node:internal/modules/cjs/loader:1706:14) { host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at Object.<anonymous> (/opt/iobroker/node_modules/which-builtin-type/index.js:11:12) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at require (node:internal/modules/helpers:147:16) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at Module.require (node:internal/modules/cjs/loader:1463:12) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at wrapModuleLoad (node:internal/modules/cjs/loader:237:24) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at TracingChannel.traceSync (node:diagnostics_channel:328:14) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at Function._load (node:internal/modules/cjs/loader:1192:37) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15) host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/iobroker.nina/main.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/iobroker.nina/node_modules/traverse/index.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/typedarray.prototype.slice/index.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/typedarray.prototype.slice/implementation.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/es-abstract/2024/TypedArraySpeciesCreate.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/es-abstract/2024/TypedArrayCreateFromConstructor.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/es-abstract/2024/IsTypedArrayOutOfBounds.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/typed-array-byte-offset/index.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/reflect.getprototypeof/polyfill.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/reflect.getprototypeof/implementation.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: - /opt/iobroker/node_modules/which-builtin-type/index.js host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: Require stack: host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: Error: Cannot find module 'function.prototype.name' host.ioBroker 2026-01-14 08:06:01.949 error Caught by controller[0]: ^ host.ioBroker 2026-01-14 08:06:01.948 error Caught by controller[0]: throw err; host.ioBroker 2026-01-14 08:06:01.948 error Caught by controller[0]: node:internal/modules/cjs/loader:1386Hat hier jemand eine Idee wo mein Problem ist?
Danke und Grüße,
ClausMit einem "iobroker fix" konnte ich es beheben :-)
-
(Edit 16.1.: Schedule eingebaut)
Die vielen Glatteiswarungen in dem letzten Tagen haben mich inspiriert, etwa Javascript zu üben.
Ziel war, eine Visualisierung bereitzustellen, die- mit mehreren Landkreisnummern klarkommt, sinnvoll für Pendler. Was ich hier bisher gesehen habe, hatte immer nur eine Nummer eingebrannt,
- die Meldungen abhängig von ihrer Anzahl darzustellen.
Das Skript bietet noch keine Robustheit, wenn z.B. die Anzahl der Datenpunkte von der Anzahl der tatsächlich aktiven Meldungen abweicht.
Auch hat es keinen Trigger...Als Trigger läuft es 5minütlich. Hier im Thread gibt es auch Beispiele, es an die Änderung der Anzahl der Meldungen zu binden, wobei zu überlegen ist, wie man alle Landkreise berücksichtigt.
Es schreibt am Ende in zwei User-Datenpunkte, die existieren müssen, der kurze ist für eine Überschrift gedacht, der andere aggregiert alle vorhandenen Meldungen in einen HTML-Block.
Das HTML lässt sich in der vis-2 mit einem Basic String (unescaped) darstellen, dieser unterstützt einen Scrollbar. Für diesen
CSS Allgemein -> overflow-y = visible.
Die HTML-Formatierung ist weiter ausbaufähig.schedule('3,8,13,18,23,28,33,38,43,48,53,58 * * * *', function(obj) { const landkreise = [11000, 12067]; const warnung_components = [ //'info01.headline', //handle headline separately 'info01.description', 'info01.instruction', 'source', 'msgType', 'info01.event', 'info01.severity', 'info01.category01', 'info01.certainty', 'info01.contact', 'sent', 'info01.effective', 'info01.expires', //'info01.fullText', broken values of "headline + description + instruction" but delivers NaNundefined 'info01.responseType01', 'info01.senderName', 'info01.urgency', 'info01.web' ]; var outstring = ''; var shortstring = ''; landkreise.forEach(lk => { var object_string = 'nina.0.' + lk; var number_warn = getState(object_string + '.'+ 'numberOfWarn').val //alternative: nina.0.11000.numberOfWarn var lk_name = getObject(object_string).common.name; outstring += ('<h2>\n'+ lk_name + ' hat ' + number_warn + ' Nina-Warnung/en.\n\n</h2>'); shortstring += ('<p>\n'+ lk_name + ': ' + number_warn + '\n</p>') if ((number_warn > 0) && (number_warn < 100)) { // more than 99 do not fit into naming scheme for (let i=1; i <= number_warn; i++) { outstring += ('<hr>'); var object_string_warn = object_string + '.' + 'warnung' + ("0" + i).slice(-2) outstring += ('<p>\n'+object_string_warn+'\n\n</p>'); outstring += ('<h3>\n'+(getState(object_string_warn+ '.info01.headline').val)+'\n\n</h3>'); warnung_components.forEach(wc => { outstring += ('<p><small>'+wc+':</small> '+(getState(object_string_warn+ '.' +wc).val) + '\n</p>').replace('info01.', ''); }); } outstring += ('<hr>'); } }); setState('0_userdata.0.visualisations.nina_aggregated_short', shortstring); setState('0_userdata.0.visualisations.nina_aggregated_warnings', outstring); //console.log(outstring); });
@hardwarefehler tolle Idee! Schau ich mir mal genauer an (wenn ich dazu komme). Hätte ich auch Verwendung dafür.