Read attributes in payload in order to recall them later

Alright everyone ( aka @kermit) I dont think Im gonna figure this one out, even after posting this.

So I envision a flow where when my kid is asleep, if she opens her door, the ambient lighting behind the TV flashes purple to alert me and my wife.

I just need to know how can I get node red to check the attributes (brightness, hs_color, rgb_color, xy_color, effect) prior to changing it to flash purple. So that after I have it flash purple a few times, I can set it to go back to its previous scheme.

I know how to look at the attributes but dont know how to “save” them in order to recall later.

[{"id":"34cbeb7e.4d7094","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"a4084cb8.34042","type":"api-current-state","z":"34cbeb7e.4d7094","name":"","server":"ab3e2c53.e3491","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hyperion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1255,"y":333,"wires":[["fdd42955.dbccd8"]]},{"id":"f3309ec7.f3b1e","type":"inject","z":"34cbeb7e.4d7094","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1267,"y":252,"wires":[["a4084cb8.34042"]]},{"id":"fdd42955.dbccd8","type":"debug","z":"34cbeb7e.4d7094","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1238,"y":423,"wires":[]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHomeRpi","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Hi, there is a “global” Namespace in Node-RED where you can store any data, which then will be available in every flow. To copy something to it, you can use a change node:


You can name the variables as you like, so don’t worry about the german names in my example :wink:

1 Like

That did the trick! Thanks