I´ve made a CasparCG-State-Scanner that you can run on your CCG-server (build for ver.2.1.x)
You can query it, and it knows the state of the server.
Foreground, background, length, countdown, loop, paused etc.
And you can query or subscribe to it with GraphQL.
Here´s a simple React Client, that subscribe to the server and gets realtime update, including timeLeft of playing clip.
It´s also used as state manager for CasarCG-ClipTool (https://github.com/olzzon/CasparCG-ClipTool)
Try it out, it´s actually a pretty cool way to know whats going on, on your server.