Any way to detect Kore connection and deconnection events?

Hi,

first of all, I hope I am posting in the proper forum section. If not, any direction would be appreciated.

I am considering tinkering with the external HDMI switch connecting my Kodi install to my TV. For this purpose, I’d first like to detect both that a Kore remote just connected to my Kodi, and that it disconnected.

In this way I’d be able to set the active HDMI channel to the one on which Kodi is connected when launching the remote, and that it get back to the TV box channel when Kore is exited. (Note that I’m not asking here about ways to control this switch; I have my idea on the matter.)

My setting is the following: Kodi installed on OSMC (2016.02-3), running on a Raspberry Pi 3.

So, is this information available somewhere in the logs? Or is there a standard API in Kodi to register to such events?

Regards,
Olivier.