Function global.get not working anymore

I am using the following code for a “function”, code has worked earlier but has now stopped to work:

var lat1 = global.get('homeassistant.HomeAssistantFRL.states["device_tracker.franks_iphone_13"].attributes.latitude');
msg.payload = lat1;
return msg;

But this returns “undefinded”.

I have also tried with:

msg.payload = lat1;
return msg;

This also returns “undefined”.

It seems like the syntax has changed.
Any idea what is wrong?

Second code should be:

var lat1 = global.get('homeassistant.HomeAssistantFRL.states["sun.sun"].attributes.elevation');
msg.payload = lat1;
return msg;

Open your home assistant server node, open any HA node, hit the pencil next to the server name, are globals enabled?

image