Hue lights back to last known state

This forum is archived topics from before the plugin was moved to the new owner. All topics are locked, but are preserved here for future reference.
Albatros
Posts: 132
Joined: Sat Feb 07, 2015 4:52 am

Hue lights back to last known state

Post by Albatros »

Maybe asked before but is it possible to get the hue lights to the last known state from Indigo when the power has been off and comes on again.

If saving and restoring the state of the lights isn't the solution is it possible for Indigo to know if the hue hub has been down so you can trigger form Indigo some actions. Or get notified when bulbs have goe offline



https://community.home-assistant.io/t/s ... n/11186/15
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Hue lights back to last known state

Post by nsheldon »

Hi.

Let me see if I can answer your questions one at a time.
Albatros wrote:...is it possible to get the hue lights to the last known state from Indigo when the power has been off and comes on again.
No. There might be some rather complex triggers that could be used to save various device states then restore them, but designing that would probably be rather tedious.
Albatros wrote:...is it possible for Indigo to know if the hue hub has been down so you can trigger form Indigo some actions.
Yes, sort of. If you enable the SQL Logger plugin (which is included with Indigo), you could create a trigger to execute whenever any Hue Lights Error appears in the Indigo log. This isn't quite the same as detecting whether the Hue hub is down, but Hue Lights Error log entries are pretty rare and usually only appear if there's a problem communicating with the Hue hub. If you used that as a trigger, you'd need to use some kind of condition in the trigger to prevent it from firing over and over again after the first error appeared, though, because the Hue Lights plugin shows an error every 4 seconds or so if it completely looses contact with the hub.
Albatros wrote:Or get notified when bulbs have goe offline
Yes. However, bulbs only show as "disconnected" if the Hue hub itself reports that the bulb is having communication problems. So, if the Hue Lights plugin can't even connect to the Hue hub, it won't change the sate of every bulb to "disconnected" because it's not the bulb that's disconnected, it's the hub. Granted, if the hub is not reachable, neither is the bulb (at least from an Indigo perspective), but the Hue Lights plugin is intended to just be a kind of conduit between Indigo and the Hue hub, so it tries to only show changes in Hue devices if those changes come directly from the Hue hub itself.

Ultimately, there isn't an easy solution to the scenario you're talking about. Lost Hue hub connectivity could potentially be included in the Hue Lights plugin in the future. As you might imagine, just from trying to find a solution yourself, it can get complicated and isn't something that can be added quickly.
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Hue lights back to last known state

Post by Different Computers »

I could imagine a fairly easy brute force and crude way of doing this, but it would be more of a rough guess return to state than a surgical return.

Set up scenes for your typical states--time of day and house occupancy for example--and run triggers that fire at system start up (that's possible, right?) with conditions so you get the default state for the time of day and occupancy status.

In other words:

Trigger: Start up
Condition: between midnight and 6 am
Action: turn off all hue lights

and

Trigger: Start up
Condition: between 6AM and 6 pm
Action: turn on daytime light scene

and

Trigger: Start up
Condition: between 6pm and 6 am and someone is home
Action: set evening lights.

and so on.

Now I'm curious--IS there an indigo start trigger? EDIT: Duh, of COURSE there is. "Indigo Server Startup" right there in the Trigger type list.
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.
Locked

Return to “Archives”