[SOLVED] Capture Color Temp or Color and restore

Hello I experience some troubles to set a rule with a virtual motion sensor linked in ifttt with a wyze motion sensor, I want to set a rule like this- when my motion sensor is active I want to turn on a hue color bulb to red, no matters if it's on or off and then if my motion sensor turns inactive I want to restore the same bulb to a previous state, if it's off before the motion capture then turn off again when the sensor changes to inactive, and if it's on restore to a previos state, color, level, temperature, any body can help me please, I'm new with the HE hub. thanks.
This is my configuration in the RM: