Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phillips Hue: How to restore previous state of bulb when using electric switch?

I have a number of Philips Hue bulbs at home, but they are only used pretty much like classic on/off-no-color light bulbs today, mainly because I do find electric switches more useful than pulling out my iPhone or correct HueTap just to turn the light on/off. - Every time the Hue bulb is switch off, it forgets its state and always comes back on at 100% brightness in white color.

After lots of googling (and not finding any solutions) I wonder whether I am missing the point and why others do not have this problem.

I am certainly not keen on doing software or even hardware work here, but if I had a reasonable idea I'd love to evaluate such path:

  • is there anything planned from Philips to fix this? The last firmware update did not help and Philips product support explained that this is not a bug, it is just the way it is designed.
  • any new "stateful" bulbs?
  • any work-arounds like patched / custom bulb or bridge firmware?
  • any recommendation on how to tackle this problem?
  • Assuming the Hue bulbs themselves do not have any memory installed, I guess they always switch on at 100% brightness and then register with the bridge? And this would be the earliest possible moment to restore the previous state?
  • Can this problem be solved using Hue SDK? (how long does it take for a turned on bulb to be controllable by the Hue Bridge? What is the quickest way for a Java program to get notified of a bulb being electrically turned on?)
  • any chance to get the previous state restored in a quicker way if using some ZigBee protocol/techniques directly?

Any hints are much appreciated.

Best regards, Christian

like image 403
user5479199 Avatar asked Oct 24 '15 13:10

user5479199


People also ask

Does Philips Hue bulbs Remember last setting?

The lights will save the last state that they were set after 7 seconds. If this is the off state in the Hue app, they will remain off after 7 seconds.

How do you reset a Hue bulb with a dimmer switch?

With the Philips Dimmer Switch in hand, bring it within 10 cm of the bulb or lamp you wish to factory reset, then press and hold the I and 0 buttons simultaneously. Continue holding for 10 seconds until the green LED illuminates on the dimmer switch, the bulb will flash just before receiving the green LED.

How do you resync a Hue bulb?

Reset a Philips Hue bulbFrom the main screen of the app, tap Settings (bottom right corner), and choose Lights. Tap on the light you want to reset, then tap Delete. The device gets forgotten by the app, and is ready to be added again or used in a completely different system.


1 Answers

I agree that it might be irritating that the last state of a light bulb is not being preserved. There is a thread on the developer site of Hue, which gives some insight:

  • Apparently, there are internal discussions on this topic. The team at Philips hesitates to implement a restore of the previous state due to "security reasons": A user could be left in the dark, if she uses the electrical switch, but the previous state was "off". This opinion has been reiterated in a tweet. There is no definite conclusion in the thread yet.
  • You can do a workaround and continuously record the state of each bulb, and restore, if necessary. There is a Node.JS script on GitHub that seems to be doing exactly this. If you want to run this as a stand-alone solution, buy a Raspberry Pi (or something similar).

One problem with an SDK based solution is the latency: In my setup, it takes between 3-9 seconds to recognize a light bulb as being switched on and about 20-30 seconds to recognize a light bulb being switched off.

Here is my Python code for monitoring the reachability of my light bulbs, using python-hue-client:

from hueclient.api import hue_api
from hueclient.models.light import Light
from datetime import datetime
from subprocess import call


if __name__ == '__main__':
    my_ids = (1, 4, 5) # IDs of my light bulbs

    def handle(resource, field, previous, current):
        print "{} {}: changed reachability from {} to {}".format(datetime.now().isoformat(), resource.name, previous, current)

    hue_api.authenticate_interactive(app_name='test-app')

    # register my light bulbs
    for id in my_ids:
        light = Light.objects.get(id=id)
        print "{}: reachability is {}".format(light.name, light.state.reachable)
        # Monitor only the reachability of the light
        light.monitor(field=lambda l: l.state.reachable, callback=handle, poll_interval=0.1)

    print("Starting monitoring. Control-c to exit.")

    # Start the monitoring loop
    hue_api.start_monitor_loop()
like image 62
Stephan Avatar answered Nov 20 '22 00:11

Stephan