A controller class
You can create a controller class by selecting Class from diagram toolbar and click on the diagram. Name the class properly to represent the nature of controller class. Very often, people name controller class as SomethingController where the Something refers to a use case or the model that the controller need to manage. For example, a PhoneController is for controlling operations of a telephone and managing its states like waiting, dialing, etc.
You can add attributes to the class by right clicking on it and selecting Add > Attribute from the popup menu. Attributes defined will be generated to code. However, you do NOT need to add attributes for states nor attributes for remembering states. Everything about states will be managed by the state machine in state machine diagram.
Add operations to the class by right clicking on it and selecting Add > Operation from the popup menu. There should be operations that may update the state.