Automating the kitchen light using a motion sensor – version 2

Carrying on from my previous post about home automation. This is how I achieved automating my kitchen light switch.

The requirements.

  • Version 1 – When someone walks into the kitchen turn the light on.
  • Version 2 – Only turn the light on when it is dark
  • Version 3 – Turn the light off after 2 minutes after it was turned on by detecting motion.

The Process

Please click on the images to make them larger and easier to read.

Version 2

This uses IFTTT and apilio.io

As you can see from my previous blog IFTTT works fine for very simple commands, but if you want to add a little complexity i.e. only switch the light on when it is dark, then it currently is too much.

But do not despair there is another site that allow us to set states and will send triggers to IFTTT if several conditions are met.

So using both sites I have set up several applets to turn the kitchen lights on if it is dark.

 

(Applets can be setup in the same way as my previous blog setting up version 1)

  1. Create a new boolean variable on the apilio.io site –

Note – Remember to create all the variable names in lower case. They don’t have to be, but it is a good practice to get into.

I called mine ‘day’

2. Create two conditions

I called mine ‘day-time’ for when ‘day’ was true

and ‘night-time’ for when ‘day’ was false

3. Do the same as steps 1 & 2 for a movement variable except it only need to have one condition kitchen-movement.

4. Create a Logicblock

 

In IFTTT four applets are required

  1. Set day variable to true at sunrise –
    Trigger: Service – Weather Undergrand, trigger – Sunrise.
    Action: Service – Webhook, url – The url is shown in the variable information at apilio setting the ‘day’ to true
  2. Set day variable to false at sunset –
    Trigger: Service – Weather Undergrand, trigger – Sunset.
    Action: Service – Webhook, url – The url is shown in the variable information at apilio setting the ‘day’ to false
  3. Set the kitchen light trigger.
    Trigger: Service – Energenie, trigger – Motion detected for Kitchen sensor
    Action: Service – Webhook, url – The url is shown in the variable information at apilio setting the ‘movement’ to true
  4. Turn kitchen light on when it is dark.
    Trigger: Service – Webhook, trigger – event name  – the name of the event setup in the logicblock on apilio
    Action: Service – Energenie, Power on device – kitchen light.

As you see it is getting quite complicated to automatically turn the light in at night when the sensor detects movement. Because of this complexity it means there is quite a lag between the movement being detected and the light coming on.

This entry was posted in Advice, News and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *