Open door control on truck fleet

I would need to check if the doors of the trucks in my fleet are open or closed at any time.

In the 2 doors, when they are closed, I would like to place 2 RUUVI in each door.
When the doors open, the 2 RUUVI move away.

Can they dialogue and understand if they move away from a certain width?

Example, if between 2 RUUVI the distance is 10 centimeters, = doors closed, if greater = doors open.

I would also like to attack them at the door in an intelligent way, which, if it is detached, must signal it to me.

Do you say we can do it?

A hall effect sensor or a magnetometer and a magnet would work. But, unfortunately, RuuviTag has neither of these sensors onboard by default.

Check puck.js instead