Get PVR status (Is backend server alive or not?)

Hi everyone,

I searched everywhere but I didn’t find the response.

I use a computer as a TVHeadend server. And I have another one with my TV screen for Kodi.

When I’m not watching TV since 15 minutes my TVHeadend server goes to sleep.

When I press the ‘x’ key I have a python script that WOL my TVheadend server and automatically start a specific channel.

Does it exist a XBMC python fonction or a JSON API to get the status of the PVR add-on in Kodi. If yes, I can add a while loop after my WOL to wait that Kodi “see” the TVheadend server and only after that start a TV channel.

Thanks a lot!

(And sorry for my english)

PS: My current script work with a while loop that always try to access the TVHeadend admin web page but sometimes the web page of TVHeadend is accessible but Kodi has not already “see” the PVR Backend …