I have an attribute called brightness and I just want to add some value to it say + 50.
Now I can not figure out to get the brightness value and send it back with the new value.
Hope someone can help.
[{"id":"2207ca62eaa5238c","type":"inject","z":"1c5c34058085e784","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":1560,"wires":[["ad8b96aa54b62730"]]},{"id":"0b13b99a1c3a2849","type":"function","z":"1c5c34058085e784","name":"","func":"r = Number;\nr = msg.data.attributes.brightness;\nmsg.data.attributes.brightness = r + 50\n\nreturn r;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":1560,"wires":[["a04e59c3cb0274ed"]]},{"id":"a04e59c3cb0274ed","type":"debug","z":"1c5c34058085e784","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"attributes.brightness","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":1560,"wires":[]},{"id":"ad8b96aa54b62730","type":"api-current-state","z":"1c5c34058085e784","name":"","server":"a465afba.fb6ee","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.lcl001","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"data.attributes.brightness","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":1560,"wires":[["0b13b99a1c3a2849"]]},{"id":"a465afba.fb6ee","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]