I am new at using UnRaid but I have a few suggestions...
On this part of the script:
# control of external timeout
checkTCP=$no # check for TCP activity
pingIPs="" # do not sleep if <$pingsIPs> are pingable
# example: <pingIPs="192.168.1.4 192.168.1.5">
# no ping-check: <pingIPs="">
I see that you are not checking for TCP activity. I do. This tells the UnRaid server to verify if any of your HT(appliances) is ON or NOT. If no appliance is ON then it would start a counter to shut off.
I you were to use this option, simply change the NO for YES and, under "pingIPs=" list the IP's of your appliances inside the quotes...
Good Luck...