ioBroker / ioBroker.node-red

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

Wrong error message that alias has improper source in read function #460

Closed mickym2 closed 3 months ago

mickym2 commented 3 months ago

Since version 5.2.0 i get from the node-red adapter error messages how I configure my alias states??

`

node-red.0 | 2024-03-30 18:46:15.746 | error | source in "alias.0.schalter.bu_maxlan.on" does not exist for "read" function: "val === 'on' ? true : false" -- | -- | -- | --

`

Why is this a topic of the NodeRed Adapter? In previous versions this error doesnt appear? Can it be as this an mqtt topic the alias reading function refers to a folder or a state which has child objects, that this error is generated?

Please correct, as this is not an error.

Apollon77 commented 3 months ago

That error happens because node-red want to read or write that state ... could that be? And so the node-red adater can. ot do that because of the invalid alias definition.

lease correct the alias defintiion and the error will go away

mickym2 commented 3 months ago

Why was this closed? - The alias definition is correct and works since months/years??? What should I correct??

https://forum.iobroker.net/topic/73810/immer-merkw%C3%BCrdigere-log-eintr%C3%A4ge-des-nodered-adapters

image

image

I feel that problems are not taken seriously and the mqtt structure is standard and given by the shelly device.

The read works properly:

image

And it seems that the error message does not appear each time the alias was read. May be that there is an overload problem and not worth to investigate further. As this error does not appear frequently or only once until now this can be closed. But the "solution" to change the alias definition is NOT correct!!!!!

mickym2 commented 3 months ago

image

Definition of source: { "_id": "mqtt.1.shellies.steckdosen.buero.max.relay.0", "common": { "name": "shellies/steckdosen/buero/max/relay/0", "write": true, "read": true, "role": "variable", "desc": "mqtt client variable", "type": "string" }, "native": { "topic": "shellies/steckdosen/buero/max/relay/0" }, "type": "state", "from": "system.adapter.mqtt.1", "user": "system.user.admin", "ts": 1670913626765, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }

Definition of alias: { "_id": "alias.0.schalter.bu_maxlan.on", "type": "state", "common": { "name": "on", "role": "", "type": "boolean", "desc": "Manuell erzeugt", "read": true, "write": true, "def": false, "alias": { "id": { "read": "mqtt.1.shellies.steckdosen.buero.max.relay.0", "write": "mqtt.1.shellies.steckdosen.buero.max.relay.0.command" }, "read": "val === 'on' ? true : false", "write": "val ? 'on' : 'off'" } }, "native": {}, "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator", "state": 1636 }, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1670913989857 }

Apollon77 commented 3 months ago

as Diskussed in Forum ... sorry for being tgat short here. If it would persist as error would be a js.controller topic ...