How movementcounter is calculated?

I installed new RT to three doors of our home, in order to use them as bulgar alarm, i.e. when door moves Node-red sends alarm to Telegram. Sometimes I get false alarms so Iā€™m interested to know how movementcounter is actually calculated.

Also I ask would it better to use XYZ values to detect door opening?