Can't see any states under Global

I’m trying to write some Node Red to publish a sensor via MQTT to my Victron NodeRed.

I found this thread on how to get the state value into NR.

From this I found the sensor states listed under Global Contexts, and copied the path.

global.get('homeassistant.homeAssistant.states["sensor.electricity_export_daily"].state')

It worked for a very short period, but then stopped, I think it stopped before I updated everything that had an update in the pallate, I’ve restarted Node Red, and HA, but there is still nothing listed in the Globals section, its empty.

I’ve refreshed the global context, but still nothing, they were listed previously, as I copied the path as per the code above.

Any idea’s, am I missing something?

Check to see if it’s enabled in the server config

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/node/config-server.html#enable-global-context-store

1 Like

@Kermit Thank you for your reply, it helped, but I also did some reading whilst at work today.

One of the articles I read reminded me I had a warning come up last night for “Unused config nodes”, and it was Home Assistant server, now I had been trying various things, and thought it was related to that, so deleted it (I was being told it was unused). I realised today that was when what I had working stopped working.

It turns out I still had a Home Assistant server, but it needed setting up again, and now it works, and I can easily send any sensor value via MQTT now.

Oddly I still get that warning that its unused, why is that?

ETA: I think NR thinks its unused as I was getting the value via Globals and NR doesn’t see the connection. I added an events state node, and now it no longer complains about the server being unused