I checked again electronic circuit:
It is possible to take some measurements on HAT interface's pin "5VIN". Measured voltages:
If powered by USB:
~4.7V
Powered by battery and switched off:
~0.7V
Powered by battery and switched on:
~2.4V
Using voltage divider with two same resistors, we get usable logic values for HIGH and LOW ( ~2.3V and ~1.2V). The measured values are not inside garanteed logic range but as a workaround: it works well.
Maybe it helps someone else...