Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. [gelöst] Daten aus Homewizard - JSON -Datei in iobroker als Geräte mit Status anzeigen

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.7k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.2k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    16
    1
    3.1k

[gelöst] Daten aus Homewizard - JSON -Datei in iobroker als Geräte mit Status anzeigen

Geplant Angeheftet Gesperrt Verschoben Skripten / Logik
27 Beiträge 6 Kommentatoren 5.3k Aufrufe
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • paul53P Offline
    paul53P Offline
    paul53
    schrieb am zuletzt editiert von
    #21

    @Sirius_77:

    Ich vermute mal, die regelmäßige Ausführung des Scriptes erreiche ich mit de, Befehl schedule('*/10 * * * * *', function); // alle 10 s `
    Richtig.
    @Sirius_77:

    [error]

    javascript.0 script.js.23: Fehler beim einlesen: null `
    Sorry, mein Fehler (kommt von copy & paste). Richtig (in Funktion getHomeWizard() und in request fast am Ende):

            if(error) log('Fehler beim einlesen: ' + error, 'error');
    

    nicht if(!error) !

    @Sirius_77:

    Wenn ich als function createDevices setze (wär für mich das logischste) `
    createDevices() benötigt man nur einmal. In der Folge - nachdem die Datenpunkte erzeugt wurden - müssen nur noch die Datenpunkt-Zustände aktualisiert werden. Das macht die Funktion setStates().

    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

    1 Antwort Letzte Antwort
    0
    • S Offline
      S Offline
      Sirius_77
      schrieb am zuletzt editiert von
      #22

      Also der Einlesefehler ist weg :) - das ! bei Errors war es.

      Wenn ich das Script starte, erhalte ich eine ganze Reihe von 'Warnmeldungen' im Log - Devices tauchen unter 'Objekte' - Javascript.0.HomeWizard aber nicht auf :(

      Script (Version Paul53)

      ! const request = require('request');
      ! const options = {
      ! url: 'http://192.168.1.xx/xxxxxx/swlist.json'
      ! };
      ! const path = 'javascript.' + instance + '.HomeWizard.';
      ! function setStates(dps) {
      ! var nameDev, idDev, status;
      ! for(var i =0; i < dps.length; i++) {
      ! nameDev = dps__.name;
      ! idDev = nameDev.replace(/\s+/g, '');
      ! status = true;
      ! if(dps__.status === 'off') status = false;
      ! setState(path + idDev + '.status', status);
      ! if(dps__.type === 'dimmer') setState(path + idDev + '.dimlevel', dps__.dimlevel);
      ! if(dps__.type === 'hue') {
      ! setState(path + idDev + '.color.hue', dps__.color.hue);
      ! setState(path + idDev + '.color.sat', dps__.color.sat);
      ! setState(path + idDev + '.color.bri', dps__.color.bri);
      ! }
      ! }
      ! }
      ! function getHomeWizard() {
      ! request(options,function (error, response, body){
      ! if (error) log('Fehler beim einlesen: ' + error, 'error');
      ! else setStates(JSON.parse(body).response);
      ! });
      ! }
      ! function CreateDevices(dps){
      ! var nameDev, idDev, status;
      ! for(var i =0; i < dps.length; i++) {
      ! nameDev = dps__.name;
      ! idDev = nameDev.replace(/\s+/g, '
      ');
      ! if(getState(path + idDev + '.status')) return;
      ! status = true;
      ! if(dps__.status === 'off') status = false;
      ! createState(path + idDev + '.status', status, {
      ! name: nameDev + '.status',
      ! type: 'boolean',
      ! role: 'switch',
      ! read: true,
      ! write: false,
      ! states: {
      ! false: 'off',
      ! true: 'on'
      ! }
      ! });
      ! if(dps_.type === 'dimmer') createState(path + idDev + '.dimlevel', dps_.dimlevel, {
      ! name: nameDev + '.dimlevel',
      ! type: 'number',
      ! role: 'level',
      ! read: true,
      ! write: false,
      ! min: 0,
      ! max: 100,
      ! unit: '%'
      ! });
      ! if(dps_.type === 'hue') {
      ! createState(path + idDev + '.color.hue', dps_.color.hue, {
      ! name: nameDev + '.color.hue',
      ! type: 'number',
      ! role: 'level',
      ! read: true,
      ! write: false,
      ! min: 0,
      ! max: 255
      ! });
      ! createState(path + idDev + '.color.sat', dps_.color.sat, {
      ! name: nameDev + '.color.sat',
      ! type: 'number',
      ! role: 'level',
      ! read: true,
      ! write: false,
      ! min: 0,
      ! max: 255
      ! });
      ! createState(path + idDev + '.color.bri', dps_.color.bri, {
      ! name: nameDev + '.color.bri',
      ! type: 'number',
      ! role: 'level',
      ! read: true,
      ! write: false,
      ! min: 0,
      ! max: 255
      ! });
      ! }
      ! }
      ! }
      ! request(options,function (error, response, body){
      ! if (error) log('Fehler beim einlesen: ' + error, 'error');
      ! else CreateDevices(JSON.parse(body).response);
      ! });
      ! schedule('*/10 * * * * *', getHomeWizard); // alle 10 s__________________________ ___Log (Auszug)

      ! __________javascript.0
      ! 2017-10-30 01:40:07.282
      ! info
      ! Stop script script.js.23
      ! javascript.0
      ! 2017-10-30 01:40:01.151
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.151
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.151
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.151
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.150
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.150
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.150
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.150
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.150
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.149
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.149
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.149
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.149
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.148
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.148
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.146
      ! warn
      ! State "javascript.0.HomeWizard.Bs.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.146
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.146
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.146
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.145
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.145
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.145
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.145
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.144
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.144
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.144
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.144
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.143
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.143
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.143
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.142
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.140
      ! warn
      ! State "javascript.0.HomeWizard.Bs.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.140
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.140
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.139
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.139
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.139
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.139
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.139
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.138
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.138
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.138
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.138
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.138
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.137
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.137
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.135
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.133
      ! warn
      ! State "javascript.0.HomeWizard.Stern.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.133
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.133
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.132
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.132
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.131
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.131
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.127
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.126
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.126
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.126
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.125
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.125
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.125
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.124
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.124
      ! warn
      ! at setStates (script.js.23:21:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.122
      ! warn
      ! State "javascript.0.HomeWizard.Lichtbox.color.bri" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.122
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.122
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.122
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.121
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.121
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.121
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.121
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.121
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.120
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.120
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.120
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.120
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.119
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.119
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.119
      ! warn
      ! at setStates (script.js.23:20:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.117
      ! warn
      ! State "javascript.0.HomeWizard.Lichtbox.color.sat" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.117
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.117
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.116
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.116
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.116
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.115
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.115
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.115
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.115
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.115
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.114
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.114
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.114
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.114
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.113
      ! warn
      ! at setStates (script.js.23:19:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.110
      ! warn
      ! State "javascript.0.HomeWizard.Lichtbox.color.hue" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.110
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.110
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.109
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.108
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.108
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.107
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.107
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.107
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.106
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.106
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.106
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.106
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.105
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.105
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.104
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.103
      ! warn
      ! State "javascript.0.HomeWizard.Lichtbox.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.102
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.102
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.102
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.102
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.101
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.101
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.101
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.101
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.101
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.100
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.100
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.100
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.099
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.099
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.098
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.097
      ! warn
      ! State "javascript.0.HomeWizard.Kueche.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.097
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.096
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.096
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.096
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.095
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.095
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.095
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.095
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.094
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.094
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.094
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.094
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.094
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.093
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.093
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.084
      ! warn
      ! State "javascript.0.HomeWizard.Badezimmer.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.083
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.083
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.083
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.083
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.083
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.082
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.082
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.082
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.082
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.081
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.081
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.081
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.080
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.080
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.079
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.078
      ! warn
      ! State "javascript.0.HomeWizard.Flur.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.077
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.077
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.077
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.076
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.076
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.075
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.075
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.075
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.074
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.074
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.074
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.073
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.073
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.073
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.072
      ! warn
      ! at setStates (script.js.23:17:38)
      ! javascript.0
      ! 2017-10-30 01:40:01.071
      ! warn
      ! State "javascript.0.HomeWizard.Wohnzimmertisch.dimlevel" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.071
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.070
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.070
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.068
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.068
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.068
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.067
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.067
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.066
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.066
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.065
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.065
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.064
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.064
      ! warn
      ! at Request._callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.063
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.062
      ! warn
      ! State "javascript.0.HomeWizard.Wohnzimmertisch.status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.062
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.062
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.061
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.061
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.061
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.060
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.060
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.060
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.060
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.059
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.059
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.059
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.058
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.058
      ! warn
      ! at Request.callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.058
      ! warn
      ! at setStates (script.js.23:21:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.056
      ! warn
      ! State "javascript.0.HomeWizard.Hue_lightstrip
      .color.bri" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.055
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.055
      ! warn
      ! at _combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.054
      ! warn
      ! at endReadableNT (_stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.054
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.054
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.053
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.053
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.052
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.052
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.052
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.052
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.051
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.051
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.051
      ! warn
      ! at Request.callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.050
      ! warn
      ! at setStates (script.js.23:20:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.049
      ! warn
      ! State "javascript.0.HomeWizard.Hue_lightstrip
      .color.sat" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.048
      ! warn
      ! at process._tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.047
      ! warn
      ! at combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.047
      ! warn
      ! at endReadableNT (stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.046
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.046
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.045
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.045
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.045
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.044
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.044
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.043
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.043
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.042
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.041
      ! warn
      ! at Request.callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.041
      ! warn
      ! at setStates (script.js.23:19:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.039
      ! warn
      ! State "javascript.0.HomeWizard.Hue_lightstrip
      .color.hue" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.039
      ! warn
      ! at process.tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.038
      ! warn
      ! at combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.038
      ! warn
      ! at endReadableNT (stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.038
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.037
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.037
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.037
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.037
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.036
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.035
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.034
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.034
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.033
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.025
      ! warn
      ! at Request.callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.024
      ! warn
      ! at setStates (script.js.23:16:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.022
      ! warn
      ! State "javascript.0.HomeWizard.Hue_lightstrip
      .status" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.021
      ! warn
      ! at process.tickCallback (internal/process/next_tick.js:104:9)
      ! javascript.0
      ! 2017-10-30 01:40:01.020
      ! warn
      ! at combinedTickCallback (internal/process/next_tick.js:80:11)
      ! javascript.0
      ! 2017-10-30 01:40:01.019
      ! warn
      ! at endReadableNT (stream_readable.js:974:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.019
      ! warn
      ! at IncomingMessage.emit (events.js:185:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.018
      ! warn
      ! at emitNone (events.js:91:20)
      ! javascript.0
      ! 2017-10-30 01:40:01.018
      ! warn
      ! at IncomingMessage.g (events.js:292:16)
      ! javascript.0
      ! 2017-10-30 01:40:01.018
      ! warn
      ! at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
      ! javascript.0
      ! 2017-10-30 01:40:01.017
      ! warn
      ! at Request.emit (events.js:188:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.017
      ! warn
      ! at emitOne (events.js:96:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.016
      ! warn
      ! at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
      ! javascript.0
      ! 2017-10-30 01:40:01.015
      ! warn
      ! at Request.emit (events.js:191:7)
      ! javascript.0
      ! 2017-10-30 01:40:01.015
      ! warn
      ! at emitTwo (events.js:106:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.014
      ! warn
      ! at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
      ! javascript.0
      ! 2017-10-30 01:40:01.014
      ! warn
      ! at Request.callback (script.js.23:29:14)
      ! javascript.0
      ! 2017-10-30 01:40:01.014
      ! warn
      ! at setStates (script.js.23:21:13)
      ! javascript.0
      ! 2017-10-30 01:40:01.012
      ! warn
      ! State "javascript.0.HomeWizard.Hue_iris_clear.color.bri" not found
      ! javascript.0
      ! 2017-10-30 01:40:01.011
      ! warn
      ! at process.tickCallback (internal/process/next_tick.js:104:9)
      ! ….
      __________Fazit: Das Script Version @Paul53 läuft, legt aber keine Devices an.

      Das Script Version @Lucky läuft, legt Devices an, führt aber dazu, dass wenn ich versuche, das mit Schedule regelmäßig auszuführen, der Javascript-Adapter abstürzt :P

      Nun gehe ich ratlos ins Bett.

      LG und Gn8

      Markus / Sirius77__________

      @paul53:

      @Sirius_77:

      Ich vermute mal, die regelmäßige Ausführung des Scriptes erreiche ich mit de, Befehl schedule('*/10 * * * * *', function); // alle 10 s ` Richtig.
      @Sirius_77:

      __________[error]

      javascript.0 script.js.23: Fehler beim einlesen: null__________ ` Sorry, mein Fehler (kommt von copy & paste). Richtig (in Funktion getHomeWizard() und in request fast am Ende):

              if(error) log('Fehler beim einlesen: ' + error, 'error');
      

      nicht if(!error) !

      @Sirius_77:

      Wenn ich als function createDevices setze (wär für mich das logischste) createDevices() benötigt man nur einmal. In der Folge - nachdem die Datenpunkte erzeugt wurden - müssen nur noch die Datenpunkt-Zustände aktualisiert werden. Das macht die Funktion setStates(). ___

      Vorhanden ist:

      • Raspberry 3

      • Harmony Hub

      • Philips Hue - Basis

      • Smartwares HomeWizard - Basis

      • Amazon Echo + Dot inkl. Alexa

      • Ifttt-Integration

      1 Antwort Letzte Antwort
      0
      • paul53P Offline
        paul53P Offline
        paul53
        schrieb am zuletzt editiert von
        #23

        @Sirius_77:

        erhalte ich eine ganze Reihe von 'Warnmeldungen' im Log - Devices tauchen unter 'Objekte' - Javascript.0.HomeWizard aber nicht auf `
        Die Warnmeldungen sind die Folge der fehlenden Datenpunkte.

        Vermutlich ist eine Abfrage auf existierenden Datenpunkt nicht korrekt, deshalb kommentiere bitte die Zeile aus:

        //        if(getState(path + idDev + '.status')) return;
        

        Um zu sehen, ob das Erzeugen von Datenpunkten Fehler-Logs erzeugt, kommentiere auch erst mal das schedule() aus:

        // schedule('*/10 * * * * *', getHomeWizard);  // alle 10 s
        
        

        Wenn die Datenpunkte erzeugt wurden, muss schedule() wieder aktiviert werden.

        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

        1 Antwort Letzte Antwort
        0
        • L Offline
          L Offline
          Lucky
          schrieb am zuletzt editiert von
          #24

          Sirius_77, poste bitte mal dein ganzes Skript mit meinem Code teil…

          das beim ersten erstellen der States einen Warnmeldung kommt ist "normal" da die Überprüfung ob der State existiert zu dieser Meldung führt, kann man aber auch unterdrücken..

          1 Antwort Letzte Antwort
          0
          • paul53P Offline
            paul53P Offline
            paul53
            schrieb am zuletzt editiert von
            #25

            Die Überprüfung auf Existenz eines Datenpunktes funktioniert mit getObject() anstelle von getState():

                    if(getObject(path + idDev + '.status')) return;
            

            Habe es im Original-Skript korrigiert.

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            1 Antwort Letzte Antwort
            0
            • L Offline
              L Offline
              Lucky
              schrieb am zuletzt editiert von
              #26

              @paul53:

              Die Überprüfung auf Existenz eines Datenpunktes funktioniert mit getObject() anstelle von getState():

                      if(getObject(path + idDev + '.status')) return;
              

              Habe es im Original-Skript korrigiert. `

              stimmt :D dann führt es auch nicht zu einer Warnung

              habe das bei mir auch geändert und einen Intervall eingefügt

              `var request = require('request');
              
               Intervall = setInterval(SendRequest,1000);
              
              function SendRequest(){
              
                  var options = {
                      url: 'http://192.168.1.xx/xxxx/swlist.json'
                  };
              
                  request(options,function (error, response, body){
              
                      if (!error){
                          CreateDevices(JSON.parse(body));
                          console.log(body);
              
                      }
              
                      else{ console.error(error);}
              
                  });
              
              }//End of Function SendRequest
              
              function CreateDevices(data){
              
              if ("undefined" !== typeof  data.response){    
              
                  var Group_by='name';
              
                  for (i = 0; i < data.response.length; i++) {
              
                               for (var ObjName in data.response[i]) {
              
                                   if (!getObject('javascript.0.tests.Devices.'+data.response[i][Group_by].toString().replace(/\s+/g, '_')+'.'+ObjName)){
              
                                       createState('javascript.0.tests.Devices.'+data.response[i][Group_by].toString().replace(/\s+/g, '_')+'.'+ObjName,data.response[i][ObjName],{type: typeof data.response[i][ObjName], role: ObjName});
              
                                       console.log('ERSTELLT');
                                   }
              
                                   else{setState('javascript.0.tests.Devices.'+data.response[i][Group_by].toString().replace(/\s+/g, '_')+'.'+ObjName,data.response[i][ObjName],akt=true)}
                               }
                  }
              }
              else{console.warn('Response in JSON nicht gefunden ! ')}
              
              }//End of Function CreateDevices` [/i][/i][/i][/i][/i][/i][/i]
              
              1 Antwort Letzte Antwort
              0
              • S Offline
                S Offline
                Sirius_77
                schrieb am zuletzt editiert von
                #27

                Ganz herzlichen Dank an Paul53 und Lucky!

                Beide Varianten des Scripts laufen jetzt, wie sie sollen! :D

                Glücklicherweise habe ich mir die Scripte in Textdateien gesichert - iobroker scheint mir abgeschmiert zu sein.

                Mal schauen, ob ich das wieder zum Laufen bekomme…

                Vorhanden ist:

                • Raspberry 3

                • Harmony Hub

                • Philips Hue - Basis

                • Smartwares HomeWizard - Basis

                • Amazon Echo + Dot inkl. Alexa

                • Ifttt-Integration

                1 Antwort Letzte Antwort
                0
                Antworten
                • In einem neuen Thema antworten
                Anmelden zum Antworten
                • Älteste zuerst
                • Neuste zuerst
                • Meiste Stimmen


                Support us

                ioBroker
                Community Adapters
                Donate

                988

                Online

                32.4k

                Benutzer

                81.5k

                Themen

                1.3m

                Beiträge
                Community
                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                ioBroker Community 2014-2025
                logo
                • Anmelden

                • Du hast noch kein Konto? Registrieren

                • Anmelden oder registrieren, um zu suchen
                • Erster Beitrag
                  Letzter Beitrag
                0
                • Home
                • Aktuell
                • Tags
                • Ungelesen 0
                • Kategorien
                • Unreplied
                • Beliebt
                • GitHub
                • Docu
                • Hilfe