Automatically restart or disable/enable addon after Wake from Suspend

  • Hello,

    Running LibreELEC 9.2.4 but same issue since 9.0. Using Tvheadend PVR Client (pvr.hts) addon to connect to Tvheadend backend on a different machine. My LibreELEC system is set up to go to Suspend after 15 minutes of inactivity. Once it goes to Suspend, I awake LibreELEC using Yatse or by pressing power button (Intel NUC). Once it wakes from suspend, TVH PVR Client does not seem to start or connect to the backend. It is showing information (for example, programs currently recording) from the moment LibreELEC went to Suspend.

    It will stay like this until I attempt to do something with TVH, for example watch channel or play recording. TVH PVR Client then re-connects to the backend, re-loads guide, refreshes recording list, etc. and typically does not play the channel or recording. This behavior is consistent, it happens every time from Suspend (or so it seems that way). This behavior has been mentioned before on various forums and I believe it is up to the addon creator to fix it.

    I can "fix" this problem if LibreELEC can automatically restart an addon upon Wake or if I can disable then enable TVH PVR Client addon. Is this possible using a script? Specifically can I do with with TVH PVR Client addon?

  • I found out I can disable/enable addon using JSON-RPC and also I can do it using the Sleep/Resume script per LibreELEC wiki. What I did was create a script named 01-restart_pvr_client.power, created "sleep.d" folder in ".config" folder, put the script there. Now it executes upon Resume and it first disables TVH PVR Client then enables it after 10 seconds. This fixes my problem for now.