ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 30 forks source link

iobroker list node returns only state objects #155

Closed mickym2 closed 3 years ago

mickym2 commented 3 years ago

The iobroker list node only return states, no channels, devices or other types - which are offered in the GUI as filter. So only Filter=Any and Filter=States return state objects and also Filter=Any returns only states-objects.

May be that this is OK as devices and channels will not return values which is an option, but then this filter option is obsolet if only state-objects can be returned.

Apollon77 commented 3 years ago

Please show the config of the list node

mickym2 commented 3 years ago

I am not sure, why the configuration is relevant. I only said that the list node only returns state objects.

So I have the following configuration in iobroker:

screen

If I use the list node with Filter Any then I am missing the channel type:

screen

If I switch the filter to "channel" or any other type as "Any" or "State" there is no output. So currently the list nodes returns only states and the filter makes no sense!

Here is the config of the list node with objType === 'channel':

[ { "id": "97d8867a.b38bf8", "type": "ioBroker list", "z": "dce8fa20.2e93c8", "name": "", "topic": "0_userdata.0.dimmer.*", "objType": "channel", "regex": "", "asArray": "false", "onlyIDs": "true", "withValues": "false", "x": 600, "y": 1780, "wires": [ [ "77ae0f2b.c670b" ] ] } ]

Apollon77 commented 3 years ago

I am not sure, why the configuration is relevant

Because the code reacts very different based on the config.

Apollon77 commented 3 years ago

Ok, now I got it. Please try github version (restart after install) ... after close by commit

Apollon77 commented 3 years ago

fixed

mickym2 commented 3 years ago

Oh - please restore the last version - this fix breaks the adapter. :(

node-red.0 | 2021-03-07 17:11:07.431 | info | (2884) node-red exited with 6
-- | -- | -- | --
node-red.0 | 2021-03-07 17:11:05.978 | warn | (4591) Terminated (UNCAUGHT_EXCEPTION): Without reason
node-red.0 | 2021-03-07 17:11:05.977 | info | (4591) terminating
node-red.0 | 2021-03-07 17:11:05.469 | error | (4591) adapterObjects is not defined
node-red.0 | 2021-03-07 17:11:05.468 | error | (4591) ReferenceError: adapterObjects is not defined at IOBrokerListNode._inputCallback (/opt/iobroker/node_modules/iobroker.node-red/nodes/ioBroker.js:690:17) at /opt/iobroker/node_modules/io
node-red.0 | 2021-03-07 17:11:05.467 | error | (4591) unhandled promise rejection: adapterObjects is not defined
node-red.0 | 2021-03-07 17:11:05.465 | error | (4591) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
node-red.0 | 2021-03-07 17:11:05.188 | error | (4591) adapterObjects is not defined
node-red.0 | 2021-03-07 17:11:05.187 | error | (4591) ReferenceError: adapterObjects is not defined at IOBrokerListNode._inputCallback (/opt/iobroker/node_modules/iobroker.node-red/nodes/ioBroker.js:690:17) at /opt/iobroker/node_modules/io
node-red.0 | 2021-03-07 17:11:05.185 | error | (4591) unhandled promise rejection: adapterObjects is not defined
node-red.0 | 2021-03-07 17:11:05.182 | error | (4591) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
node-red.0 | 2021-03-07 17:10:54.491 | info | (2884) Starting node-red: --max-old-space-size=512 /opt/iobroker/node_modules/iobroker.node-red/node_modules/node-red/red.js -v --settings /opt/iobroker/iobroker-data/node-red/settings.js
node-red.0 | 2021-03-07 17:10:49.490 | info | (2884) node-red exited with 6
Apollon77 commented 3 years ago

fixed on github

Apollon77 commented 3 years ago

(sorry)

mickym2 commented 3 years ago

OK - the adapter started again - however the list nodes gives not any output at all- not even states - so the node is totally broken with this configuration.

mickym2 commented 3 years ago

As I have no backup of the previous fix - it would be great if this version is restored, if this becomes a bigger problem to fix the list nodes with the object types.

Apollon77 commented 3 years ago

I think I found it. try again please, else we need to add debug

mickym2 commented 3 years ago

No output of list nodes at all. So I opened my test project to have not so much message flows. Should I directly switch on debug log - or do you need something special to prepare before?

Apollon77 commented 3 years ago

I added some debug ... please update from github ... (sorry, was looking that straight forward change)

Apollon77 commented 3 years ago

WAIT STOP!!!

Apollon77 commented 3 years ago

Now pelase ... noew version (that maybe already fixes it ... grmpff

mickym2 commented 3 years ago

So the list node produce no outputs anymore. If I trigger the list nodes I get empty arrays of ID_s

The "Full set ids" occurs when I trigger the list node.

`

node-red.0 2021-03-07 18:35:10.483 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:35:10.464 debug (32755) Add states
node-red.0 2021-03-07 18:35:07.900 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:35:07.726 debug (32755) Add adapters
node-red.0 2021-03-07 18:35:07.396 debug (32755) Add instances
node-red.0 2021-03-07 18:35:07.381 debug (32755) Add metas
node-red.0 2021-03-07 18:35:07.364 debug (32755) Add states
node-red.0 2021-03-07 18:35:07.341 debug (32755) Add channels
node-red.0 2021-03-07 18:35:07.312 debug (32755) Add devices
node-red.0 2021-03-07 18:35:07.293 debug (32755) Add folders
node-red.0 2021-03-07 18:34:35.468 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:34:35.447 debug (32755) Add states
node-red.0 2021-03-07 18:34:33.269 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:34:33.238 debug (32755) Add adapters
node-red.0 2021-03-07 18:34:33.220 debug (32755) Add instances
node-red.0 2021-03-07 18:34:33.202 debug (32755) Add metas
node-red.0 2021-03-07 18:34:33.185 debug (32755) Add states
node-red.0 2021-03-07 18:34:33.169 debug (32755) Add channels
node-red.0 2021-03-07 18:34:33.139 debug (32755) Add devices
node-red.0 2021-03-07 18:34:33.110 debug (32755) Add folders
node-red.0 2021-03-07 18:34:05.453 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:34:05.439 debug (32755) Add states
node-red.0 2021-03-07 18:33:56.166 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:33:56.149 debug (32755) Add adapters
node-red.0 2021-03-07 18:33:56.131 debug (32755) Add instances
node-red.0 2021-03-07 18:33:56.116 debug (32755) Add metas
node-red.0 2021-03-07 18:33:56.092 debug (32755) Add states
node-red.0 2021-03-07 18:33:56.063 debug (32755) Add channels
node-red.0 2021-03-07 18:33:56.037 debug (32755) Add devices
node-red.0 2021-03-07 18:33:56.010 debug (32755) Add folders
node-red.0 2021-03-07 18:33:35.090 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:33:35.067 debug (32755) Add states
node-red.0 2021-03-07 18:33:29.208 debug (32755) Full set ids: []
node-red.0 2021-03-07 18:33:29.192 debug (32755) Add adapters
node-red.0 2021-03-07 18:33:29.180 debug (32755) Add instances
node-red.0 2021-03-07 18:33:29.169 debug (32755) Add metas
node-red.0 2021-03-07 18:33:29.156 debug (32755) Add states
node-red.0 2021-03-07 18:33:29.143 debug (32755) Add channels
node-red.0 2021-03-07 18:33:29.131 debug (32755) Add devices
node-red.0 2021-03-07 18:33:29.117 debug (32755) Add folders
node-red.0 2021-03-07 18:33:20.589 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.586 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.582 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.579 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.575 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.572 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.567 info (311) Automatic objects creation is not enabled. You can enable it in the node configuration
node-red.0 2021-03-07 18:33:20.510 debug (32755) 7 Mar 18:33:20 - [info] Flows gestartet
node-red.0 2021-03-07 18:33:20.418 debug (32755) 7 Mar 18:33:20 - [info] Flows starten
node-red.0 2021-03-07 18:33:20.344 debug (311) statesDB connected
node-red.0 2021-03-07 18:33:20.343 debug (311) States connected to redis: 127.0.0.1:9000
node-red.0 2021-03-07 18:33:20.330 debug (32755) 7 Mar 18:33:20 - [info] Flow-Datei: /opt/iobroker/iobroker-data/node-red/projects/MWTest/flow.json
node-red.0 2021-03-07 18:33:20.329 debug (32755) 7 Mar 18:33:20 - [info] Aktives Projekt: MWTest
node-red.0 2021-03-07 18:33:20.318 debug (311) States create User PubSub Client
node-red.0 2021-03-07 18:33:20.316 debug (311) States create System PubSub Client
node-red.0 2021-03-07 18:33:20.285 debug (311) Redis States: Use Redis connection: 127.0.0.1:9000
node-red.0 2021-03-07 18:33:20.282 debug (311) objectDB connected
node-red.0 2021-03-07 18:33:20.270 debug (311) Objects connected to redis: 127.0.0.1:9001
node-red.0 2021-03-07 18:33:20.241 debug (32755) 7 Mar 18:33:20 - [info] Server wird jetzt auf http://127.0.0.1:1880/ ausgeführt.
node-red.0 2021-03-07 18:33:20.145 debug (311) Objects client initialize lua scripts
node-red.0 2021-03-07 18:33:20.144 debug (311) Objects create User PubSub Client
node-red.0 2021-03-07 18:33:20.141 debug (311) Objects create System PubSub Client
node-red.0 2021-03-07 18:33:20.126 debug (311) Objects client ready ... initialize now
node-red.0 2021-03-07 18:33:18.060 debug (311) Redis Objects: Use Redis connection: 127.0.0.1:9001
node-red.0 2021-03-07 18:33:20.050 debug (32755) 7 Mar 18:33:20 - [info] Benutzerverzeichnis: /opt/iobroker/iobroker-data/node-red/
node-red.0 2021-03-07 18:33:20.048 debug (32755) 7 Mar 18:33:20 - [info] Kontextspeicher: 'default' [ module=memory]
node-red.0 2021-03-07 18:33:20.045 debug (32755) 7 Mar 18:33:20 - [info] Einstellungsdatei: /opt/iobroker/iobroker-data/node-red/settings.js
node-red.0 2021-03-07 18:33:19.593 debug (32755) 7 Mar 18:33:19 - [info] Dashboard version 2.28.1 started at /ui
node-red.0 2021-03-07 18:33:15.369 debug (32755) 7 Mar 18:33:15 - [info] Paletten-Nodes werden geladen
node-red.0 2021-03-07 18:33:14.720 debug 7 Mar 18:33:14 - [info] Linux 5.10.11-v7l+ arm LE
node-red.0 2021-03-07 18:33:14.720 debug (32755) 7 Mar 18:33:14 - [info] Node.js Version: v14.16.0
node-red.0 2021-03-07 18:33:14.718 debug (32755) 7 Mar 18:33:14 - [info] Node-RED Version: v1.2.9
node-red.0 2021-03-07 18:33:14.715 debug ===================
node-red.0 2021-03-07 18:33:14.715 debug Willkommen bei Node-RED!
node-red.0 2021-03-07 18:33:14.715 debug (32755) 7 Mar 18:33:14 - [info]
node-red.0 2021-03-07 18:33:13.246 info (32755) Starting node-red: --max-old-space-size=512 /opt/iobroker/node_modules/iobroker.node-red/node_modules/node-red/red.js -v --settings /opt/iobroker/iobroker-data/node-red/settings.js

`

Apollon77 commented 3 years ago

Was this the version after my "oh stop ... now again"? Or before?

mickym2 commented 3 years ago

After your "oh stop ..."

Apollon77 commented 3 years ago

WTF ... so again please update, restart and log ... moar debug

mickym2 commented 3 years ago

So to help for further investigation.

I tried different variants of using the list node - no out at all:

screen

The flow of these 3 list nodes:

[ { "id": "97d8867a.b38bf8", "type": "ioBroker list", "z": "4641d5bc.f856dc", "name": "", "topic": "0_userdata.0.dimmer.*", "objType": "", "regex": "", "asArray": "false", "onlyIDs": "true", "withValues": "false", "x": 1040, "y": 880, "wires": [ [ "77ae0f2b.c670b" ] ] }, { "id": "77ae0f2b.c670b", "type": "debug", "z": "4641d5bc.f856dc", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1310, "y": 880, "wires": [] }, { "id": "c439d848.da0898", "type": "inject", "z": "4641d5bc.f856dc", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 810, "y": 880, "wires": [ [ "97d8867a.b38bf8" ] ] }, { "id": "65ca51dd.3a4f2", "type": "inject", "z": "4641d5bc.f856dc", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "0_userdata.0.dimmer.*", "x": 830, "y": 960, "wires": [ [ "1e959c88.7272e3" ] ] }, { "id": "1e959c88.7272e3", "type": "ioBroker list", "z": "4641d5bc.f856dc", "name": "", "topic": "", "objType": "", "regex": "", "asArray": "false", "onlyIDs": "true", "withValues": "false", "x": 1080, "y": 960, "wires": [ [ "c4df74df.fef888" ] ] }, { "id": "c4df74df.fef888", "type": "debug", "z": "4641d5bc.f856dc", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1310, "y": 960, "wires": [] }, { "id": "8e261e29.7c6d1", "type": "ioBroker list", "z": "4641d5bc.f856dc", "name": "", "topic": "0_userdata.0.dimmer.brightness", "objType": "", "regex": "", "asArray": "false", "onlyIDs": "true", "withValues": "false", "x": 1050, "y": 1040, "wires": [ [ "54db5ecc.462da" ] ] }, { "id": "54db5ecc.462da", "type": "debug", "z": "4641d5bc.f856dc", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1310, "y": 1040, "wires": [] }, { "id": "2bdf645a.9831cc", "type": "inject", "z": "4641d5bc.f856dc", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 790, "y": 1040, "wires": [ [ "8e261e29.7c6d1" ] ] } ]

and finally the definition of the objects in iobroker

{ "0_userdata.0.dimmer": { "_id": "0_userdata.0.dimmer", "type": "device", "common": { "name": "dimmer", "role": "", "icon": "", "desc": "Manuell erzeugt" }, "native": {}, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1614735426933, "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }, "0_userdata.0.dimmer.brightness": { "_id": "0_userdata.0.dimmer.brightness", "type": "state", "common": { "name": "brightness", "role": "", "type": "number", "read": true, "write": true, "desc": "Manuell erzeugt", "min": 0, "max": 100, "def": 0, "unit": "%" }, "native": {}, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1614735543749, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }, "0_userdata.0.dimmer.channel1": { "_id": "0_userdata.0.dimmer.channel1", "type": "channel", "common": { "name": "channel1", "role": "", "icon": "", "desc": "Manuell erzeugt" }, "native": {}, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1615079135788, "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }, "0_userdata.0.dimmer.taster": { "_id": "0_userdata.0.dimmer.taster", "type": "state", "common": { "name": "taster", "role": "", "type": "boolean", "read": true, "write": true, "desc": "Manuell erzeugt", "def": false }, "native": {}, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1614735477595, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } } }

mickym2 commented 3 years ago

Ok - I try next version

Apollon77 commented 3 years ago

(if that do not work I need to rebuild on my test system tonight after kids are in bed

mickym2 commented 3 years ago

Still no output - but the 3 objects were found - and hopefully a useful error message. ;)

`

node-red.0 2021-03-07 18:57:26.241 debug (8375) ERR: TypeError: rows is not iterable Full set ids: []
node-red.0 2021-03-07 18:57:26.240 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:26.228 debug (8375) ERR: TypeError: rows is not iterable Add adapters
node-red.0 2021-03-07 18:57:26.226 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:26.217 debug (8375) ERR: TypeError: rows is not iterable Add instances
node-red.0 2021-03-07 18:57:26.215 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:26.202 debug (8375) Res: {"0_userdata.0.dimmer.brightness":{"_id":"0_userdata.0.dimmer.brightness","type":"state","common":{"name":"brightness","role":"","type":"number","read":true,"write":true,"desc":"Manuell er
node-red.0 2021-03-07 18:57:26.189 debug (8375) Res: {} ERR: TypeError: rows is not iterable Add states
node-red.0 2021-03-07 18:57:26.173 debug (8375) Res: {} ERR: TypeError: rows is not iterable Add channels
node-red.0 2021-03-07 18:57:26.162 debug (8375) Res: {} ERR: TypeError: rows is not iterable Add devices
node-red.0 2021-03-07 18:57:26.151 debug (8375) Add folders
node-red.0 2021-03-07 18:57:25.222 debug (8375) ERR: TypeError: rows is not iterable Full set ids: []
node-red.0 2021-03-07 18:57:25.221 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:25.211 debug (8375) ERR: TypeError: rows is not iterable Add adapters
node-red.0 2021-03-07 18:57:25.210 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:25.200 debug (8375) ERR: TypeError: rows is not iterable Add instances
node-red.0 2021-03-07 18:57:25.199 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:25.187 debug (8375) ERR: TypeError: rows is not iterable Add metas
node-red.0 2021-03-07 18:57:25.185 debug (8375) Res: {"0_userdata.0.dimmer.taster":{"_id":"0_userdata.0.dimmer.taster","type":"state","common":{"name":"taster","role":"","type":"boolean","read":true,"write":true,"desc":"Manuell erzeugt","def
node-red.0 2021-03-07 18:57:25.150 debug (8375) ERR: TypeError: rows is not iterable Add states
node-red.0 2021-03-07 18:57:25.148 debug (8375) Res: {"0_userdata.0.dimmer.channel1":{"_id":"0_userdata.0.dimmer.channel1","type":"channel","common":{"name":"channel1","role":"","icon":"","desc":"Manuell erzeugt"},"native":{},"from":"system.
node-red.0 2021-03-07 18:57:25.128 debug (8375) ERR: TypeError: rows is not iterable Add channels
node-red.0 2021-03-07 18:57:25.125 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:25.106 debug (8375) ERR: TypeError: rows is not iterable Add devices
node-red.0 2021-03-07 18:57:25.104 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:25.083 debug (8375) Add folders
node-red.0 2021-03-07 18:57:23.557 debug (8375) ERR: TypeError: rows is not iterable Full set ids: []
node-red.0 2021-03-07 18:57:23.556 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:23.546 debug (8375) ERR: TypeError: rows is not iterable Add adapters
node-red.0 2021-03-07 18:57:23.544 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:23.534 debug (8375) ERR: TypeError: rows is not iterable Add instances
node-red.0 2021-03-07 18:57:23.533 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:23.521 debug (8375) ERR: TypeError: rows is not iterable Add metas
node-red.0 2021-03-07 18:57:23.519 debug (8375) Res: {"0_userdata.0.dimmer.taster":{"_id":"0_userdata.0.dimmer.taster","type":"state","common":{"name":"taster","role":"","type":"boolean","read":true,"write":true,"desc":"Manuell erzeugt","def
node-red.0 2021-03-07 18:57:23.505 debug (8375) ERR: TypeError: rows is not iterable Add states
node-red.0 2021-03-07 18:57:23.504 debug (8375) Res: {"0_userdata.0.dimmer.channel1":{"_id":"0_userdata.0.dimmer.channel1","type":"channel","common":{"name":"channel1","role":"","icon":"","desc":"Manuell erzeugt"},"native":{},"from":"system.
node-red.0 2021-03-07 18:57:23.492 debug (8375) ERR: TypeError: rows is not iterable Add channels
node-red.0 2021-03-07 18:57:23.491 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:23.479 debug (8375) ERR: TypeError: rows is not iterable Add devices
node-red.0 2021-03-07 18:57:23.478 debug (8375) Res: {}
node-red.0 2021-03-07 18:57:23.463 debug (8375) Add folders

`

Apollon77 commented 3 years ago

tthhaaat helped ... llaallaallaaa ... was an object, no array ... retry please

mickym2 commented 3 years ago

Hi - so it works great !!!! - with a small bug in the 2nd case - but may be that this has nothing to do with the original request - as the filter of object types works now in all 3 cases.

screen

So in the 2nd case when I add the msg.topic with wild cards through an inject node the object was found and correctly filtered but payload is undefined. But only in 2nd case - in all other cases it worked perfekt what I can see.

I guess this is a different bug. ;)

screen2

So great support - I will immediately do a backup.

So I think the original problem is solved. What is your opinion - should I open a new issue for the second case?

So even in the 2nd case - the object or all objects was/were correctly found - and I do not understand why this will not be in the payload.

`

node-red.0 2021-03-07 19:33:42.156 debug Full set ids: ["0_userdata.0.dimmer.channel1"]
node-red.0 2021-03-07 19:33:42.156 debug (11610) AddRow: 0_userdata.0.dimmer.channel1
node-red.0 2021-03-07 19:33:42.155 debug (11610) Res: {"0_userdata.0.dimmer.channel1":{"_id":"0_userdata.0.dimmer.channel1","type":"channel","common":{"name":"channel1","role":"","icon":"","desc":"Manuell erzeugt"},"native":{},"from":"syste
node-red.0 2021-03-07 19:33:42.142 debug (11610) Add channels

`

Apollon77 commented 3 years ago

Let’s check it here

Ishtar config of the list node the one from Above? Or other one? In fact I assume it might have something to do with the fact it do not have a value .. I check code after kids in bed and remove all that debug again.

Thank you for your patience.

mickym2 commented 3 years ago

So may be I found it out by myself - or at least a workaround. ;)

So the list node are still the same as posted here!

But I found out something interessting. ;)

So in the first case (topic specified in the list node) - when I trigger the node with the inject node - I can create correct out regardless which message type I use. (Only msg.topic or msg.payload - of any type.)

In the second case however (nothing specified in the list node - or topic externally specified by the input message) it seems, that the list node uses this message object instead of creating a new one. ;)

screen

So the input message which specifies the topic without a payload property - leads to the result above. ;) I found this out when I send then an empty string in the inject node as payload. ;) (see screenshot) and finally I gave the list node an empty payload object - AND IT WORKS FINE!!!!!

So a fix would be in my opinion that even if an input message specifies a msg.topic - a new msg- Object should be created. However I can live with my workarround as well. ;) ;)

Apollon77 commented 3 years ago

When I understand it correctly then this list node is configured with "only ids = true" ... so it only returns the ids and NOT value!! so payload is undefined - as configured. Am I wrong?

Apollon77 commented 3 years ago

if fact the code says:

mickym2 commented 3 years ago

No I explain it again. In the 2nd case not the node properties are touched. I added the topic via the inject node by sending a msg.topic. I anaylsed that - and it seems that when a topic is defined in the list node - it creates a separate message object for output - regardless which message triggered the node.

In case topic is specified in the input message - then this message object is used. I understand that the msg-Object is used that someone can pass other values - but then either a new payload property should have been created in the existing msg-object or as in the other nodes you can specify to which property the output should be generated.

But anyway - I have a solution which is working, when you know how the node behaves.

OK - so may be - it works as designed - but I had to find it out. ;) The description is not very extensive for the list node. ;)

screen

Many THANKS!!!!

It should be a new major release!!! - You solved 3 issues within ONE day - that happened never before - especially as a lot of issues remain open months. GREAT JOB today - YOU ARE MY HERO!

Apollon77 commented 3 years ago

Ok then leave as is. Is there any text you would think makes sense to add to description. Then tell me and i add it.

I was mainly looking into the „easy to solve“ things. ;-) feature additions or more deep stuff are needing much deeper knowledge and time ...

As usual always a matter of time.

mickym2 commented 3 years ago

OK I missunderstood. And now I understood:

So the following text in the list node should be added:

If only ID's is set to "Returns only IDs of object" then only the msg.topic is modified in the output messages and the original payload is added to each message. If only ID's is set to "Returns whole objects" then payload will contain the objects

It seems that not a lot of people have detected this as an issue. ;)

Apollon77 commented 3 years ago

Ps: and only fixes, so will be a Patch release ;-)

mickym2 commented 3 years ago

Was ist das für eine Adapterversion mit diesen ganzen Fixes? 2.1.1 ??? - weil ich sonst ja nur stable Versionen nehme - damit ich aufpassen muss, wenn die neueste größer als diese ist? Ich habe den Erklärungstext angepasst, weil ich selbst erst jetzt wirklich verstanden habe, wie sich die Option "only IDs" auswirkt. Sorry.

Also alles so lassen - das gibt ja vielmehr Möglichkeiten - so kann man dann ja mit der List Node alle Objekte auf einmal initialisieren!! IT IS A FEATURE!

Apollon77 commented 3 years ago

:-))

Am Ende ists auch so:

            let pattern = node.topic || msg.topic;

also ein msg. topic wird als topic genutzt wenn das node keins hat ...