Autopilot disengaged event, what I am doing wrong?

Hello all,
The situation is as follows. I am on a long flight and am not always at the PC. And would like to be informed when the autopilot flies out. e.g. when there is a weather update and the Airbus goes into over speed, the autopilot flies out. Here I would like to be informed then. A program for this is already created. The only problem is that I don’t know how to query the autopilot if it is on or off. The variable Autopilot_Master does not work in Fenix or PMDG.
Can someone help me here?
Thanks
Superflo5c

I have a program written here with me that calls me when the sim stands (the coordinates no longer move) I would now like this program what is based on the simWatcher also calls me when the autopilot goes off.

gladly also write in German.