Any time HA fires a state change event for an entity it’s updated and cached in NR. The global scope is actually generated from the internal cache of HA entities every time any event state is received from HA. So they should always be in sync but you’re able to modify or delete the global context which won’t update the internal cache of entities.
1 Like
That’s badass. I knew that the global object (cache) was there, but I didn’t know how often it updated. As always, fantastic work @Kermit.
May I ask how your Lovelace displays Modes in this fashion whereas my dashboard lumps the modes along with all my other binary sensors?
Hi all,
Could someone share a screen shot showing how I can pass this payload to a NodeRed Service Call?
msg.payload = {};
var mode = global.get("mode", "file");
node.status({fill:"green", shape: "ring", text: mode });
mode = mode.replace(" ", "_");
msg.payload = {
domain: "scene",
service: "turn_on",
data: {
entity_id: "scene.kitchen_" + mode
}
};
return msg;