Recovery after power failure

Do you have something relating to home automation that you want to sell or trade? Post the details here.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Recovery after power failure

Post by kw123 »

With the recent disaster in Tx I would to get a working solution to restart mac and indigo after power failure

Here the main challenge
- Mac OS does not restart when power is back when shutdown gracefully

With an apc you have the opportunity to get a signal when in battery / less then x energy left ..
then you can decide to shutdown the mac.
But then when power comes back the mac does not restart.

One could stop indigo and let the the mac crash at the end of power so that it restarts
- not the preferred solution
And when the power comes back before the battery is drained indigo does not know it should restart.

Here my qs:
- Does a wol package wake a mac or how YI configure it
- How to start indigo from the command line
- has anyone solved this or any other ideas?

Karl


Sent from my iPhone using Tapatalk
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Recovery after power failure

Post by Different Computers »

A less than complete answer is to use Energy Saver Preferences to start the mac at a set time each day. That's less than optimal because if the power goes 3 minutes after the daily start schedule it won't boot up until tomorrow, but it's, excuse the pun, a start.

https://techviral.net/schedule-startup-shutdown-on-mac/

As for starting Indigo, can you have auto-login enabled? If so, then just configure Indigo server to start on login.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Recovery after power failure

Post by kw123 »

I remember. And you could set it in a command every 5 minutes to now+2 hours.

But that also is bad if the power outage lasts 2hours and 5 minutes.


Sent from my iPhone using Tapatalk
yassi
Posts: 498
Joined: Sun Sep 06, 2015 7:14 am
Location: Germany

Re: Recovery after power failure

Post by yassi »

What about putting a SwitchBot on the power button (if the Mac model allows it) and restart it “manually”?


Gesendet von iPhone mit Tapatalk
agame
Posts: 514
Joined: Thu Jul 13, 2017 10:29 pm
Location: Melbourne, Australia

Re: Recovery after power failure

Post by agame »

i'm running indigo at a remote location with unreliable mains power, so tried unsuccessfully for a long time to find a solution to this - my compromise [pending a whole of house battery being cost-effective] is a UPS to cover typical outages but allow a hard shutdown at in the end.

It does occur to me it would be possible to partly soften the shutdown by eg unmounting drives just before the shutdown hits (and reversing if mains power returns) but have never put in the effort.

Pre-indigo i used a telephone-line actuated relay to remotely reboot when required various 12-volt network appliances including a Vera unit. Small DTMF driven relays are readily available for this purpose [but i assume require a traditional POTS landline?]. It worked really well.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Recovery after power failure

Post by kw123 »

works, just tested, soft shutdown of indigo mac server (mojave)
then in terminal on an rpi:
wakeonlan 40:6c:8f:bc:19:ed (that is the mac number of my indigo mac )
and mac came back up

So here a possible setup:

indigo shutsdown at 10% bat left, then the mac shuts down

On an RPi that goes up/down w power

run the script (symbolic):

Code: Select all

lastOk = time.time()
while true:
  if testpin(ipofmac): # test if mac server answers ping
   lastOk = time.time() 
   continue
 if time.time () - lastok > 300 secs # every 5 minutes
    subprocess.popen("wakeonlan mac#of indigoserver", shell=true)
    lastOk = time.time()
that should do it. will test

Karl
agame
Posts: 514
Joined: Thu Jul 13, 2017 10:29 pm
Location: Melbourne, Australia

Re: Recovery after power failure

Post by agame »

great idea...which reminded me of an old vera i use to run a device that won't talk to indigo. I can use the Vera WOL plugin to do the same.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Recovery after power failure

Post by kw123 »

it only worked once. the second time i tried it nothing happened.. mac stayed off :(

need to dig deeper
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Recovery after power failure

Post by kw123 »

It looks like the mac has to be in sleep mode not in power off mode tor wol to work. That might also depend on the type of mac: Mac Pro, mac book, Mac mini ...


Sent from my iPhone using Tapatalk
agame
Posts: 514
Joined: Thu Jul 13, 2017 10:29 pm
Location: Melbourne, Australia

Re: Recovery after power failure

Post by agame »

damn.
User avatar
McJohn
Posts: 681
Joined: Tue Dec 18, 2012 5:58 am
Location: The Netherlands
Contact:

Re: Recovery after power failure

Post by McJohn »

Nice and interesting thread!
We are using an APC 650 UPS for ~10 years now (with the UPS and Battery monitor Plugin).
In 7 of 8 times of a power failure in 10 years it does what is has to do: continuously and stable provide the power for almost an hour.
So, you have also to calculate the risk how many times this (big) problem of a loooong power failure happens?

This one is for you Karl:
https://www.youtube.com/watch?v=GKyLJRs5Q3k
:D
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Recovery after power failure

Post by kw123 »

And I really like the Italian.


Sent from my iPhone using Tapatalk
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Recovery after power failure

Post by kw123 »

... and it is a problem that needs a solution. Even if it happens once every 100 years. We can’t just give up. I could not sleep without trying to solve it.


Sent from my iPhone using Tapatalk
peszko
Posts: 334
Joined: Wed Mar 07, 2012 5:37 pm

Re: Recovery after power failure

Post by peszko »

My approach was to buy an oversized UPS and a backup generator. I have the whole computer closet (all the networking, cameras and indigo) connected to a server ups that will run all of this for a bit over five hours. Since I'm hardly ever longer than that away from the house, this gives me enough time to spin up the generator (on a manual transfer switch). Id love to have an automatic transfer switch with an auto start generator, but until now the it has been out of my price range.
User avatar
McJohn
Posts: 681
Joined: Tue Dec 18, 2012 5:58 am
Location: The Netherlands
Contact:

Re: Recovery after power failure

Post by McJohn »

kw123 wrote:... and it is a problem that needs a solution. Even if it happens once every 100 years. We can’t just give up. I could not sleep without trying to solve it.
That could be my text Karl. I completely agree with you!

So, shall I contact the Italian? :wink:
An extension of the Arduino Plugin? :D
Or maybe a redirect from the Mac mini power switch (inside) to a relais or so to the GPIO port of an Rpi?
Post Reply

Return to “Classifieds”