Send Data from UR to Phyton

Hello,
How can I send the status of the robot, e.g. that it is running or going into a safety stop, send to a Raspberry Pi?
Our aim is to use the status to control a Werma lamp via a relayshield which is controlled with a Raspberry Pi . All the Digital Outputs are in Use, so there is no Option to use them. Which commands (maybe for RTDE when it should be the best tool for this application) or other tools can I use to read out the safety/emergency status of the robot?

As you said, using RTDE is a good choice, it can give you the information you want, such as robot_mode, safety_modeā€¦