Thanks Guys. All working here. The plugin was already disabled so my path was in the Plugins (Disabled) folder.
Made the changes and enabled the plugin - all working fine.
kw123 wrote:for the situation that the ups shuts down the mac gracefully and the power comes back and the mac does not restart:
run a script every 30 minutes that sets a power on event in one hour from now, eg it is 7 am in the morning the script would issue a command
echo yourpasswordhere | sudo -S pmset repeat wakeorpoweron MTWRFSU 08:00:00
and at 7:30
echo yourpasswordhere | sudo -S pmset repeat wakeorpoweron MTWRFSU 08:30:00
this would guarantee that your mac wakes up while you are not home , but only if the power comes back within the hour, otherwise it would wait 24 hours, but at least It would wake up.
Karl
you could put this into an action and run it every 30 minutes::
- Code: Select all
import datetime, time, subprocess
nextTimeString = datetime.datetime.fromtimestamp(time.time() +3600).strftime("%H:%M:%S")
cmd= "echo YOURPASSWORDHERE | sudo -S /usr/bin/pmset repeat wakeorpoweron MTWRFSU "+ nextTimeString
#indigo.server.log(cmd)
ret= subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate()
#indigo.server.log(str(ret))
ret= subprocess.Popen("pmset -g sched", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate()
indigo.server.log((ret[0] +" " +ret[1]).replace("\n",""))
kw123 wrote:But you need to replace the batteries every 2 years.
durosity wrote:kw123 wrote:But you need to replace the batteries every 2 years.
I've had various APC UPSes over the years and i've found the batteries tend to last 5-6 years. I prefer the ones that take standard 12v 7ah batteries as you can just replace the cells when individual ones fail.. not that APC would recommend doing that.
kw123 wrote:I just buy apc. They seem to work. But you need to replace the batteries every 2 years.
Users browsing this forum: No registered users and 1 guest