As you might imagine, Node red doesn´t accept this format and claims "Invalid properties". Then I tried to tweak it on my own for the function node to look like this:
Now Node-Red would accept the format but when running the flow the debug gives me the following error notice: Error: Invalid property expression: unexpected c at position 21
I don´t know what I am doing different from usual when using global variables, which works just fine. Anybody has an idea?
Alright, this already helped much @E1cid as I'm at least receiving a value now However, the message payload which gets returned is always "0" where it should actually be "99" as defined below.
It may help if you copy/paste the payload rather than a screen shot.
To do this, in the debug window - right side of the screen - at the top line of the message to the right you will see a little clipboard icon when you move the mouse over it.
Click that and it will copy the msg.paylaod to the clipboard.
Paste it here and we see it as text and can better help you with it as it is easier to see/read.
@Trying_to_learn , I´m not quite sure if we are on the same page here. What I´m trying to do is to use the function node to create the message payload. So if I copy what I created as payload it´s just "0".
I see no issues in the code.
Try setting the global to a variable, then use `node.warn(variable); to output to debug.
If that shows that the global is set and the value is 0 then post your flow.
I would start of by just picking up global.homeAssistant and feeding that into a debug node. If that works and shows the correct contents then work down till you find at what level the problem is.
Oh man - that was exactly it! They couldn´t have made it more complicated Thanks much again to @E1cid, @Colin and all the other contributors for taking your time to support!