The red wire is normally a secondary hot wire. On a smart switch, the purple wire generally connects into the switch leg to regulate a light or other load. In an electrical box, a red wire could be a traveler, a switch leg or the 2nd hot of the 240-volt https://electric-hub98074.blogdigy.com/smart-light-switches-fundamentals-explained-52262901