How do you disable a PVR addon or the PVR manager on idle?

Hello…

I’ve switched over to TVHeadend on my server and am running a powersaving script on the server to put the server to sleep after 15mins idle. The script checks if TVHeadend has any subscriptions (connected clients who could well be idling but they are on the network) and if it does it won’t put the server to sleep.

One of my clients is a 24/7 raspberry pi running Kodi 17 on Libreelec. This never shuts down so it stays connected to the backend constantly. I’ve added the Kodi Callbacks addon to it and have created a task which issues the builtin function StopPVRManager after 15mins idle but it doesn’t do anything. I also tried to do a json command to unload the hts addon but that didn’t work unless I launched it from a web browser and that would result in a crash.

Does anyone know how I could get this to work?

Thanks.