lorenwest / node-red-contrib-state

Node-RED shared logical state with persistence, notification, and history
MIT License
7 stars 6 forks source link

TypeError: Cannot create property 'isLightON' on number '0'" #8

Open Jamarilo opened 3 years ago

Jamarilo commented 3 years ago

I habe just tried to do your exmple "isLightOn" , but i think there is an issue, when i Deploy the the setState Node i get an the errror on the debug Window: "TypeError: Cannot create property 'isLightON' on number '0'" "No shared state for: undefined"

NodeRed v1.2.9 running in a DockerContainer on Synology

Here is my Flow:

[ { "id": "f8d5c8be.fe32e8", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "195a36e.ebbbec9", "type": "set-shared-state", "z": "f8d5c8be.fe32e8", "state": "e1c960.0c56a6a", "name": "isLightON", "triggerOnInit": true, "provideOutput": false, "outputs": 0, "x": 360, "y": 140, "wires": [] }, { "id": "506f9353.0e98ac", "type": "inject", "z": "f8d5c8be.fe32e8", "name": "On", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 130, "y": 100, "wires": [ [ "195a36e.ebbbec9" ] ] }, { "id": "ae107400.26c5e", "type": "inject", "z": "f8d5c8be.fe32e8", "name": "Off", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 130, "y": 180, "wires": [ [ "195a36e.ebbbec9" ] ] }, { "id": "e1c960.0c56a6a", "type": "shared-state", "name": "isLightON", "lbl": "", "tags": "", "historyCount": "2", "dataType": "bool", "boolType": "bool", "boolStrTrue": "", "boolStrFalse": "", "precision": "", "numMin": "", "numMax": "", "unit": "" } ]

Maybe somone can help me.

lorenwest commented 3 years ago

Interesting. I pasted your flow as-is into my palette (running v1.1.3) and it worked as expected. I do not have 1.2.9 running, so there may be a version incompatibility.

Jamarilo commented 3 years ago

You're right 😅 i tried so many things, but i didn't think that id could be a version incompatibility... With the newer version 1.3.3 it works. Thank you very much for your commitment.

Jamarilo commented 3 years ago

Oke i got the issue again, if i change something and i deploy the changes, the issue will is back again. If i restart node-red the issue is gone. 🙈 As you said before there is an incompatibility with the version...