node-red-contrib-sun-position icon indicating copy to clipboard operation
node-red-contrib-sun-position copied to clipboard

Rules: blind position does not accept flow context

Open nikipore opened this issue 10 months ago • 0 comments

Describe the bug

Create an empty rule (catchall) and set blind position to some value, say 0.15. This sets the blind position to 0.15.

Now save that same value in flow.test, and set blind position to flow.test. (I use a persistent context storefor that which survives reloads of the Node-RED flow.) You will get the following error message:

error getting blind level: Cannot set properties of undefined (setting 'flow.#:(store)::test')

Screenshots

Rule definition:

Bildschirmfoto 2023-08-25 um 08 29 06

Flow context (the screenshot has another value 0.5, sorry, just mentally replace it with 0.15):

Bildschirmfoto 2023-08-25 um 08 31 43

This is how it looks if you enter the value 0.15 statically (via "Level entered – 09"):

Bildschirmfoto 2023-08-25 um 08 33 27

And finally the error message:

Bildschirmfoto 2023-08-25 um 08 29 21

Expected behavior

The blind position should be set to the value of flow.test, viz. 0.15.

System information:

  • Node Version 3.0.0-alpha1
  • Node-Red Version 3.0.2

Additional context

I am actually interested in using the flow context for a minimum override, ideally in a JSONata expression to make the rule generic and divide by 100 to convert from the user input which is denoted in percent. I tried to inject the parameter via a message to read it from msg.test instead of flow.test or JSONata $flowContext("test", "store"), but to no avail.

nikipore avatar Aug 25 '23 16:08 nikipore