Variables with a dot in the name

Hi,
In HomeAssistant, 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 That dot in the name of the variable gets interpreted as another object (which is expected)
How can I "escape" that dot in the above expression?
I tried several ways, but without any luck.
Any tips are welcome,
thanks,
chrisV

You can try:

global.get("homeassistant.MyHomeAssistant.states['sun.sun'].state")

Can you change the name of the variable in HomeAssistant? That would seem to be a better solution

Thanks ! I had seen this alternate syntax, but I missed the trick with the single quotes. Also, I had a dot before the [...]; which was not good.
Learned something new here :slight_smile:

Unfortunately those are predefined names by HomeAssistant. Those variables are created by HomeAssistent and represent the states of the different sensor.

Thank you both, problem solved and something learned
chrisV