ioBroker.javascript icon indicating copy to clipboard operation
ioBroker.javascript copied to clipboard

on(): .deviceId, .deviceName do not work without channels

Open paul53 opened this issue 6 years ago • 7 comments

Subscription on(): If datapoints are directly assigned to devices (without channels), .deviceId and .deviceName don't work. Example: ioBroker.zigbee

paul53 avatar Aug 18 '18 11:08 paul53

https://forum.iobroker.net/viewtopic.php?f=21&t=16224#p170297

paul53 avatar Aug 18 '18 12:08 paul53

battery monitoring/visu are not available

arteck avatar Aug 29 '18 05:08 arteck

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

stale[bot] avatar Jul 27 '20 04:07 stale[bot]

Getestet mit Javascript Version 4.6.20: Das Problem besteht weiterhin.

11:07:54.039 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: hm-rpc.0.XEQ1234567.1.STATE
11:07:54.039 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: hm-rpc.0.XEQ1234567
11:07:54.040 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: HM Gerät 1
11:08:17.881 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: zigbee.0.00158d0002c8d185.open
11:08:17.882 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: null
11:08:17.882 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: null

EDIT: Die Geräte-ID und der Gerätename wird bei Auswahl von Kanal-ID und Kanalname angezeigt.

on({id: 'zigbee.0.00158d0002c8d185.open', change: "ne"}, function (obj) {
  var value = obj.state.val;
  var oldValue = obj.oldState.val;
  console.log(obj.id);
  console.log(obj.channelId);
  console.log(obj.channelName);
});

Ergebnis:

11:33:03.108 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: zigbee.0.00158d0002c8d185.open
11:33:03.109 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: zigbee.0.00158d0002c8d185
11:33:03.109 | info | javascript.1 (1506) script.js.blockly.Test3_Blockly: Gerätename

paul53 avatar Jul 27 '20 09:07 paul53

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

stale[bot] avatar Oct 28 '20 22:10 stale[bot]

Das Problem besteht weiterhin.

paul53 avatar Oct 28 '20 23:10 paul53

SHould be rechecked once https://github.com/ioBroker/ioBroker.javascript/pull/964 got merged AND you need to make sure that channel and device also are really objects! because this is verified. Return value null also comes back when the relevant objects do not exist!

Apollon77 avatar Feb 23 '22 20:02 Apollon77