In Node-Red, I want to read the value of a global variable that has a dot in the name
As an example, I want to:
The problem is the name of the variable
I tried several ways to escape that dot, but without any luck.
Any tips are welcome,
I’m re-posting the answer here in case someone else has the same issue.
I had also posted this to the Node-Red forum and user @knolleary suggested to use an alternate syntax like this:
…which solved the issue
Learned 2 things here:
- there is an alternate syntax to address the “nodes” in a JSON object
- single quotes can also be used and they don’t terminate the double quotes
I have same issue , want to access state of specific element but I cant do that from the flow.
Tried your code (adjusted to my needs)
var haCtx = global.get(“homeassistant.Home_Assistant.states[‘switch.control_ac_emilly’].state”);
but no results like its coming null.
How can I debug/check ? @chrisV