As far as I know you need to do two stores and restores to get this done. First you need to store the entity’s state (on or off) and then the entity’s attributes, and than -if your thing is done- restore the attributes and then the state.
The caveat of this is that you only can grab the attributes when the light is on, so you need to switch the light on first to do so.
Between steps 1 to 5 you need to give HA/NR some time (100ms or so, dependent on the speed of your system).
[{"id":"a05100b13db18d8e","type":"group","z":"11a02663.08c012","name":"TrapKastDeur Signaal functie WK_4","style":{"stroke":"#0070c0","fill":"#ffffbf","label":true,"color":"#0070c0"},"nodes":["9e111ba1c52a0e2c","7001965e84de2514","8172042c97344d11","f42eb1fc196943a8","785e9e38f04e37bf","5a2b6e4cf6737b58","681852033a8f630f","2e2ea2222f92fd3a","3e0fae0941862951","55e9f93b4ceab156","81f4eb65eebc4e58","95f8d302b8e2c5b8","a4bb90bd0cdb2aa4","e7c35f1d42b7dfc6","7b53683312cd5b4b","b8acae84741d3800","8f0cc76da65da7d8"],"x":3114,"y":1419,"w":982,"h":402},{"id":"9e111ba1c52a0e2c","type":"link in","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","links":["e67359e75d0dde6d"],"x":3155,"y":1460,"wires":[["81f4eb65eebc4e58","95f8d302b8e2c5b8"]]},{"id":"7001965e84de2514","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"30 sec","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3260,"y":1600,"wires":[["8172042c97344d11"]]},{"id":"8172042c97344d11","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Snapshot woonkamer_4 state","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"scene","service":"create","entityId":"","data":"{\"scene_id\":\"woonkamer_4_state_before\",\"snapshot_entities\":[\"light.woonkamer_4\"]}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"first","x":3480,"y":1600,"wires":[["8f0cc76da65da7d8"]]},{"id":"f42eb1fc196943a8","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Woonkamer_4 ON","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.woonkamer_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3440,"y":1660,"wires":[["785e9e38f04e37bf"]]},{"id":"785e9e38f04e37bf","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3620,"y":1660,"wires":[["5a2b6e4cf6737b58"]]},{"id":"5a2b6e4cf6737b58","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Snapshot woonkamer_4 attrib","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"scene","service":"create","entityId":"","data":"{\"scene_id\":\"woonkamer_4_attrib_before\",\"snapshot_entities\":[\"light.woonkamer_4\"]}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"first","x":3480,"y":1720,"wires":[["681852033a8f630f"]]},{"id":"681852033a8f630f","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3700,"y":1720,"wires":[["2e2ea2222f92fd3a"]]},{"id":"2e2ea2222f92fd3a","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Restore Woonkamer_4 State","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"scene","service":"turn_on","entityId":"scene.woonkamer_4_state_before","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3470,"y":1780,"wires":[["3e0fae0941862951"]]},{"id":"3e0fae0941862951","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3680,"y":1780,"wires":[["55e9f93b4ceab156"]]},{"id":"55e9f93b4ceab156","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Change woonkamer_4 to PURPLE","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.woonkamer_4","data":"{\"rgb_color\":[255,0,255],\"brightness\":254}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3910,"y":1780,"wires":[[]]},{"id":"81f4eb65eebc4e58","type":"change","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Reset Timer","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3280,"y":1520,"wires":[["7001965e84de2514"]]},{"id":"95f8d302b8e2c5b8","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3280,"y":1460,"wires":[["a4bb90bd0cdb2aa4"]]},{"id":"a4bb90bd0cdb2aa4","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Restore Woonkamer_4 attrib","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"scene","service":"turn_on","entityId":"scene.woonkamer_4_attrib_before","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3530,"y":1460,"wires":[["b8acae84741d3800"]]},{"id":"e7c35f1d42b7dfc6","type":"api-call-service","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"Restore Woonkamer_4 State","server":"6182da52.101a64","version":3,"debugenabled":false,"service_domain":"scene","service":"turn_on","entityId":"scene.woonkamer_4_state_before","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3950,"y":1460,"wires":[[]]},{"id":"7b53683312cd5b4b","type":"link in","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","links":["619f73dd7a895e89"],"x":3155,"y":1600,"wires":[["7001965e84de2514"]]},{"id":"b8acae84741d3800","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3740,"y":1460,"wires":[["e7c35f1d42b7dfc6"]]},{"id":"8f0cc76da65da7d8","type":"delay","z":"11a02663.08c012","g":"a05100b13db18d8e","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3710,"y":1600,"wires":[["f42eb1fc196943a8"]]},{"id":"6182da52.101a64","type":"server","name":"Wolk 9 Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"10"}]
I hope this will solve your challenge.