In Node-Red: how to address a global variable with a dot in the name?

Hi,
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:
global.get("homeassistant.MyHomeAssistant.states.sun.sun.state");
The problem is the name of the variable sun.sun
I tried several ways to escape that dot, but without any luck.
Any tips are welcome,
thanks,
chrisV

Problem solved:
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:
global.get("homeassistant.MyHomeAssistant.states['sun.sun'].state")
…which solved the issue
Learned 2 things here:

  1. there is an alternate syntax to address the “nodes” in a JSON object
  2. single quotes can also be used and they don’t terminate the double quotes
    chrisV

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