Philips Hue Motion Sensor – Create more than two time periods

0
123

A common complaint people have with the inside and outside Philips Hue Motion Sensor is that you only seem to have a choice of two time periods in the Philips Hue app.  For example, if you choose the first time period as 8am-6pm, then your second time period automatically becomes 6pm-8am.  This isn’t very practical in many cases.  How often have you wished you had more than two time periods to chose from?  For example, being able to have a daylight time period such as 8am-5pm, and then another time period between 5pm-9pm, and then finally a time period between 9pm-8am.  A scenario like this makes sense when you consider during the day between 8am-5pm, you may not need to turn a light on, but between 5pm-9pm, you might want lights to turn on at normal brightness, and then between 9pm-5am, you may want the lights to come on as a nightlight so as not to blind you if you get up to go to the Toilet.

The Philips Hue app is great, but it’s been heavily simpified for the average consumer, by only allowing two time periods.  Fortunately, Philips allow more than two time periods, but you have to set this up yourself using third party apps.  This isn’t a hack, but rather features that Philips have provided in their Application Programming Interface (API) for developers to incorporate into their own apps.  The great news is, it’s really simple to do, if you don’t mind spending a couple of minutes understanding the logic of how to use the various apps out there.  Some have bigger learning curves than others, but I’ve been using one in particular that is super easy, but really powerful at the same time.  Before I dive into this, I urge you to check out my other article about the Programming Logic of using this app.  The app is called All4Hue which is written by Rene Wahl.  I have no affiliation with the developer, and I don’t make any money from this.  I’m just a happy user of the app because it makes a rather complicated subject, and makes it really easy to do some funky things with your Philips Hue Accessories, and Light Bulbs.  There is a free version of the app which is available on both Android and iOS, but it’s limited in the number of Rules you can make.  The cost of the app is less than $10 depending on where you live.  Here in Australia, I think it’s about $7, and in the USA, I think it’s around $4.  Certainly not expensive considering the power it unleashes.

What You Need

  • Philips Hue Bridge v2
  • Philips Hue Motion Detector
  • All4Hue App

This tutorial assumes the following;

  • 1. You have your Philips Hue Light Bulbs and Accessories already installed and configured in your rooms or zones.
  • 2. You’ve already downloaded the All4Hue app, installed it, and connected it to your Philips Hue Bridge.
  • You are using the iOS app, however, it’s very similar on Android, so everything should look and function almost identically

Lets Begin

Create a Memory Sensor

If you’re reading this tutorial, you’ve probably already worked out what time periods you want. You are not limited to 3 time periods in this example.  Just follow the same logic, and you can add as many as you want.  In this example, we are going to set up 3 time periods.

The first is Sunrise to Sunset which I’ll set up to do nothing if motion is detected.  After all, during the day, you may not want any lights to turn on.

The second time period is between Sunset and 9pm so that you have normal lighting turn on when the motion detector detects motion.

The thrid one will be between 9pm and Sunrise so that if you get up in the middle of the night to use the Toilet you’re not blinded by intense lighting.

  1. The first step is to make a variable that we can change and recall later.  This is done with the Memory Sensor in the app.  Click on the Accessories option under Hue Bridge Automation.

2. In the Accessories screen where your Philips Hue Motion Sensor should be listed, click on the three dots to open the menu option.

3. Click on the New Memory Sensor for Value option, and without changing anything, just clickk the checkmark in the top right of the screen.

You should be taken back to the Accessories screen, and a new heading of Generic Memory Sensors should be visible with a new sensor called New Sensor.

4. Click on the New Sensor, and from the popup menu, choose Rename.  Rename this TimePeriod, and the click on the checkmark on the top right of the screen.

You should now have a Memory Sensor called TimePeriod, and it should have an initial value of 0.  We will be reading this value, and changing it depending on what time it is next.

Create the rules for the time periods

As you recall, we are creating three time periods.  For this reason, we need to create three trigger rules.

Sunrise Trigger

1. In the top left hand side of the screen, click on the hamburger menu to display the main menu.  Click on the Rules option listed under Hue Bridge Automation.

2. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use Sunrise Trigger so that it’s easy to identify later.

4. Click on the Add Condition button

5. Click on the Daylight Sensor button

6. Click on Regular Condition when the dialog box comes up.

7. Click on the On Sunrise option and click on the Checkmark in the top right of the screen.

8. Click on the Add Condition button

9. Click on the Daylight Sensor button again.

10. Click on Trigger Condition when the dialog box comes up.

11. Click on the Attribute “lastupdated” option, and “immediately in the Mode section.

12. Click on the checkmark

8. Click on the Add Action button

9. Choose the Write value to sensor option

The value should be 0 because that was the default we set earlier when we set up the Memory Sensor.  If it’s any other number, just change it to 0.

10. Click on the checkmark in the top right of the screen.  Click on the checkmark again to complete the rule.

The trigger rule for the first time period is now done.  We need to do this for every time period we want.

Sunset Trigger

1. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use Sunset Trigger so that it’s easy to identify later.

4. Click on the Add Condition button

5. Click on the Daylight Sensor button

6. Click on Regular Condition when the dialog box comes up.

7. Click on the On Sunset option and click on the Checkmark in the top right of the screen.

8. Click on the Add Condition button

9. Click on the Daylight Sensor button again.

10. Click on Trigger Condition when the dialog box comes up.

11. Click on the Attribute “lastupdated” option, and “immediately in the Mode section.

12. Click on the checkmark

13. Click on the Add Action button

14. Choose the Write value to sensor option

15. In the value section type 5.  Technically this can be any number, but 5pm is roughly when sunset will be, so it’s easy to remember.

16. Click on the checkmark in the top right of the screen.  Click on the checkmark again to complete the rule.

9pm Trigger

1. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use 9PM Trigger so that it’s easy to identify later.

4. Click on the Add Condition button

5. Click on the Time Interval button

6. Click on the Within Time Interval option

7. Click on the Start time and change it to 21h and leave the rest as 0m and 0s.

8. Click on the End time and change it to 21h and leave it at 0m, but change 0s to 30s.

9. Click on the checkmark.

10. Click on the Add Action button.

11. Click on the Write Value to Sensor option

10. In the value section type 9.

11. Click on the checkmark in the top right of the screen.  Click on the checkmark again to complete the rule.

We now need to create three rules that tell the Hue bridge what to do during these three time periods.

Turn off Light

1. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use Turn Off Light so that it’s easy to identify later.  This one will be used to turn off the light when no motion is detected.  It will only trigger if it’s not daytime

4. Click on the Add Condition button

5. Click on the Natural Number option and click on Regular Condition

6. Click on the Larger than value option

7. Ensure the value is set to 0 and then click on the checkmark in the top right of the screen.

8. Click on the Add Condition button again, and then Motion Sensor.

9. Click on Regular condition when the dialog box appears.

10. Choose your Philips Hue Motion Sensor from the list.

11. Choose the If Presence not detected option and click on the checkmark in the top right of the screen.

12. Click on the Add Condition button again, and again choose the Motion Sensor option.

13. This time when the dialog box appears, choose the Trigger condition option

14. Choose your motion detector again, and leave the Attribute “lastupdated” option ticked, and the same for “immediately” down below.   .

15. Click on the checkmark.

16. Click on the Add Action button.

17. Click on the Switch option

18. Click on the Turn off option.

19. Click on light you want to turn off. In this case, we’ll turn off all lights so we’ll chose this option.

20. Click on the checkmark, and then click the checkmark again to save the rule.

Sunset to 9pm

1. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use Sunset to 9pm so that it’s easy to identify later.  

4. Click on the Add Condition button

5. Click on the Natural Number option and click on Regular Condition

6. Click on the Equal to value option

7. Change the value from 0 to 5 and then click on the checkmark in the top right of the screen.

8. Click on the Add Condition button again, and then Motion Sensor.

9. Click on Regular condition when the dialog box appears.

10. Choose your Philips Hue Motion Sensor from the list.

11. Choose the If Presence detected option and click on the checkmark in the top right of the screen.

12. Click on the Add Condition button again, and again choose the Motion Sensor option.

13. This time when the dialog box appears, choose the Trigger condition option

14. Choose your motion detector again, and leave the Attribute “lastupdated” option ticked, and the same for “immediately” down below.   .

15. Click on the checkmark.

16. Click on the Add Action button.

17. Click on the Activate Scene option

18. Click on the Scene of your choice.

19. Click on light you want to turn on. In this case, we’ll turn on all lights so we’ll choose this option.

20. Click on the checkmark in the top right of the screen.

21. Click on the Add Action button again

22. Click on the Switch button.

23. Click on the Turn on option

24. Click on the light of your choice. I’m turning on All lights so i’ll use that option.

25. Click the checkmark on the top right of the screen, then the checkmark again to save the rule.

9pm to Sunrise

1. Click on the three dots in the top right of the screen.  Click on the Add new rule option.

3. Give the rule a name.  I’ll use 9pm to Sunrise so that it’s easy to identify later.  

4. Click on the Add Condition button

5. Click on the Natural Number option and click on Regular Condition

6. Click on the Equal to value option

7. Change the value from 0 to 9 and then click on the checkmark in the top right of the screen.

8. Click on the Add Condition button again, and then Motion Sensor.

9. Click on Regular condition when the dialog box appears.

10. Choose your Philips Hue Motion Sensor from the list.

11. Choose the If Presence detected option and click on the checkmark in the top right of the screen.

12. Click on the Add Condition button again, and again choose the Motion Sensor option.

13. This time when the dialog box appears, choose the Trigger condition option

14. Choose your motion detector again, and leave the Attribute “lastupdated” option ticked, and the same for “immediately” down below.   .

15. Click on the checkmark.

16. Click on the Add Action button.

17. Click on the Activate Scene option

18. Click on the Scene of your choice.

19. Click on the light you want to turn on. In this case, we’ll turn on all lights so we’ll choose this option.

20. Click on the checkmark in the top right of the screen.

21. Click on the Add Action button again

22. Click on the Switch button.

23. Click on the Turn on option

24. Click on the light of your choice. I’m turning on All lights so i’ll use that option.

25. Click the checkmark on the top right of the screen, then the checkmark again to save the rule.

You’ve now set up all the rules and saved them to the bridge, which means the rules will now trigger when they are supposed to.

If you found this tutorial helpful, please leave a comment below.

LEAVE A REPLY

Please enter your comment!
Please enter your name here