5
votes

I recently fitted out my home office with Philips HUE bulbs and a Philips HUE motion sensor that has a builtin light sensor. I was hoping that I could get up the Philips HUE Motion Sensor (with light sensor) to supplement light in the office as the sun went down so the room was always the same brightness (to save my little eyes from the strain of poor lighting)

While the sensor has have the light / lux sensor and it does allow me to set a threshold for when it should begin to turn on the lights - it does require motion and it doesn't supplement - the lights are either on or off.

I felt that this would be a pretty big limitation for lots of users and I was hoping that someone else made it possible for this smart hardware to work without the limitations of the silly software so I looked for alternatives on IFTTT but also came up with nothing.

Anyone had this issue? Any ideas on how to get around this and make it work the way I was hoping it work?

2

2 Answers

6
votes

Original answer (July 2017): You do not need to do anything fancy. In your phone Hue app, go the Explore menu option and click on Hue Labs.

Use the 'Sunlight as a switch' formula to accomplish exactly the function you are trying to perform. I have been using formulas from labs for the last few months with satisfactory performance.

Update (June 2021): 4 1/2 years after it was originally setup, I still recommend this formula. It has worked reliably all these years. It just works and you never have to mess with it after it is setup.

2
votes

There are a couple of ways you can achieve this if you are willing to tinker around with the Hue API. It's really well documented at their website. You can connect to your bridge using a web browser on your local network and you create rules by sending JSON formatted lists of conditions to be met and actions to be taken

Then it's just a case of creating some rules. You can use the values from the light sensor or alternatively once you set the location of your hue then it has a built in timer for sunset/sunrise times which might be easier than working out what light levels you want to trigger on.

You can set transition times within your rules, so here's an example how you could create a pair of rules to switch on the lights at minimum brightness an hour before sunset and then increase to maximum brightness with a transition time of 1 hour

{"conditions": [
        {
            "address": "/sensors/1/state/daylight",
            "operator": "eq",
            "value": "false"
        },
        {
            "address": "/sensors/1/state/daylight",
            "operator": "dx"
        }
    ],
    "actions": [
        {
            "address": "/groups/0/action",
            "method": "PUT",
            "body": {
    "on": true,
    "bri": 0,
            }
        }
    ]
}

The first condition specifies that the daylight sensor must be set to false (you can adjust the offset before sunset you want this to change within the hue app), the second condition uses the operator "dx" which means the value must just have changed. Then the action for the rule turns on all lights at minimum brightness.

The second rule would look like this

{"conditions": [
        {
            "address": "/sensors/1/state/daylight",
            "operator": "eq",
            "value": "false"
        },
        {
            "address": "/sensors/1/state/daylight",
            "operator": "ddx"
            "value": "PT00:01:00"
        }
    ],
    "actions": [
        {
            "address": "/groups/0/action",
            "method": "PUT",
            "body": {
    "bri": 254,
    "transitiontime":36000
            }
        }
    ]
}

The first condition is the same as before, the second condition uses "ddx" as an operator. ddx means the rule will trigger a certain amount of time after the sensor value changes, specified in the value parameter which in this case is PT00:01:00, so 1 minute after the first rule fired. The actions of this rule set all the lights to max brightness with a transition time of 1 hour (transitiontime parameters 1 = 0.1 seconds). So they will take 1 hour to reach max brightness.

Once you get into the API then Hue is really quite a powerful system that you can integrate with all sorts of other kit. There are commands to increase brightness in stages which you could couple with readings from the light sensor if you preferred to do it that way, or modify the rules above to use your light sensor as the trigger instead of the built in sunset timer.