Build first SmartThings scenario, turn off/on lights at sunset and sunrise

As I described in my previous post I want to create a couple of scenarios in my house.

The first one is a simple one. I want my lights at the front of my house automatically turn on and off when the sun sets and rises. I replaced my outlet switch with a z-wave switch and connected it to my SmartThings hub.

After that it’s easy. Go to your SmartThings apps. Click on the + sign on the bottom of the page. Swipe to Actions. Select Lighting. Choose ‘Turn lights on using a schedule’, ‘Add new light/switch’, give it a name, in my case ‘entrée’, Next, choose devices for ‘entrée’,  select what you want to switch on at the entrée so I selected my switch. Check the ‘turn on at Sunset’, you can specify the level of the dimmer as well. Next and Done.

Now repeat this step to turn lights off using a schedule to turn the lights of in the morning at sunrise.

There is probably a smartapp which can do the same, but this way you don’t have to go the webpage and add the apps through the IDE.

So first scenario is done.

Wish list SmartThings scenarios in my house

Since I bought the SmartThings hub and several switches and sensors I was thinking which scenarios I exactly want to work. So far I have been fooling around and I found out if you want a complete working set of scenarios without me using the app all the time to set my house in a state I want, I need to think it through and build all the scenarios from the beginning. So step 1 is writing the scenarios down and determine what the conditions are.

So I am listing the scenarios and will give them a number and can work from that list.

  1. Outdoor lights at the front door need to turn on at sunset and turn off at sunrise.
  2. In the morning when I come downstairs the lights in the kitchen and living need to turn on. The Sonos need to turn on in the Kitchen. Temperature set to 69. I want to use a motion sensor to detect when I come down in the morning.
    Conditions: Lights turn on when it’s still dark outside (before sunrise). When somebody comes down before 5:00 in the morning the Sonos does not have to turn on. When I come down in the morning I want to switch to ‘good morning status’ When I come downstairs before 5:00 the lights need to turn off automatically when no motion is detected after 5 minutes.
  3. When the status is ‘away’ and motion is detected switch to ‘I’m back’ and turn on the lights when it’s after sunset. The Nest needs to be set to ‘home’ when it’s in ‘away’ mode. This is when we come back through the garage or the front door (after work, or shopping or taking a walk for example)
  4. When I switch the house to ‘good night’ everything needs to switch off automatically after 5 minutes, which gives me some time to connect my phone to the charger, put the empty cup in the kitchen etc and head upstairs. Temperature is set to 60.
  5. When leaving the house I will set the status manually to ‘goodbye’. Lights will turn of after a few minutes, and Nest is switched to ‘away’ immediately. When I return home scenario 3 needs to kick in.
  6. When I leave to work I want to set the mode to ‘goodbye to work’ which means only the lights and Sonos is switched off but the Nest is left as it is. So when Sandra comes downstairs the temperature is still as we want it to be.

All these scenarios need to work without me needing to use the app. I am ok switching the lights off in the morning when it’s getting lighter outside. I might add a light sensor in the future to do this automatically as well.

When this works I want to add a sensor to our cars so the garage door can automatically open and close when we arrive and leave with the cars too.

I decided not to mess around with the ‘auto’ away settings etc from the Nest in combination with the SmartThings hub. That’s way to complicated and doesn’t add any value I think.

Adding my Aeon Labs DSB09104-ZWUS Z-Wave Smart Energy Meter

As I mentioned earlier, I bought a SmartThings hub and want to connect a couple of sensors and devices.

One of the devices I bought is an energy meter. Since I drive an electric car I wanted to get some more insights in how much energy I use charging my car (and also what I use in the house).

I found the Aeon Labs energy meter on Amazon for $35.00. Aeon Labs does have a newer version (V2) but I could not figure out why that would be a better deal for me. (and it costs $99)

The manual in the box has the install instructions. What was missing is how to pair the device to the hub. A little cardboard points you to the Verizon website (!?). Apparently they sell some kind of home automation system as well. Search on the internet brought me to a blog here: http://support.micasaverde.com/customer/portal/articles/1151131–aeon-labs-pairing-the-home-energy-meter

You have to open up the energy meter and instead of holding the black little button for 5 seconds (that didn’t work for me) I pressed it shortly several times until the light started blinking quickly. After that I could add a device in the SmartThings app and it found it immediately.

Hooking up the energy meter in my breaker panel was easy. Just connect the 2 clamps to the 2 big black wires (don’t touch them duh!) and power the meter with the usb cable and the connector in a outlet.



After this I logged in on the Web Ide from SmartThings and added a custom device type. You go to the my Device Types tab. Click on +New Smart Device, select the from code tab and I pasted the code from this github repository https://github.com/SANdood/Aeon-HEM-v2

After that go to ‘My Devices’ Select your energy meter, click edit and change the type to Aeon HEMv2. After this when you open the app you will see the amount of energy the meter is reporting. (I have to figure out what the 2 empty spots are on the left and change the script a little bit)


Next will be using a script to report this data to Xively or Bidgely to see some data over time. (and figure out if 700 Watts energy usage in the evening is a lot or not Smile)

Bought a SmartThings hub

Last week I got myself a SmartThings hub. I was already looking for some time to get into to home automation. I have a NEST thermostat, some Philips Hue lights but wanted something more.

These are the scenarios I want to try to solve:

  • I would love it when I come downstairs in the morning the lights come up (but only when it is still dark) and Sonos starts playing my music. When I leave for work, the lights need to go out, music needs to stop but the heating needs to keep the same temperature for Sandra.
  • When I come home and Sandra is already at home, nothing needs to happen, but when I or Sandra gets home and nobody is there the lights need to come up (when it’s dark only) and the heating needs to be switched on.
  • When we go to sleep I want to turn everything off with 1 button.
  • The lights at the front door and garage need to automatically turn on when it’s dark and switch of when sunrises.
  • When we are away for a longer time it would be nice if the house could look ‘alive’
  • Windows Phone support.
  • Optional it would be nice to use the system from a tablet which I could put on the wall at a central location.
  • I will probably mostly buy z-wave products

At the time I was doubting between the Vera and the Smartthings, both systems have a good community support although it looked the Smartthings stuff is more active and easier to extend myself when I want as well. Disadvantage of the ST is it always needs an internet connection. The Vera could work offline.

Since I also visited the Samsung conference a couple of weeks ago (Samsung bought ST) I got more enthusiastic after I saw a few sessions. So I went with ST and see how it goes (I can always switch to another system since the connectors, switches etc all work with other systems too)

First thing you need in this system is the hub.


Costs $99. Installation is easy. Hook it up to your network. power on. Start the ST app on your phone and add the hub by entering a special code you find in the box. That’s it.

After this you can add ‘things’ and smartapps to your system. Since I didn’t have any z-wave devices yet I added my HUE lights first and my Sonos players.

The NEST took some more work. Since it is not yet supported out of the box (but it is announced) I had to do some work. On the developer website you can login with your account and through the web-based IDE you can add custom device types yourself. This is the system to extend your ST with new devices, you can add your own developed ones as well. I got the code and instructions from here.

This is the data you can get back and use in your logic when automating your home


The apps and devices are written in a language called groovy. This is how it looks like:

// handle commands
def setHeatingSetpoint(temp) {
    def latestThermostatMode = device.latestState(‘thermostatMode’)
    def temperatureUnit = device.latestValue(‘temperatureUnit’)
    switch (temperatureUnit) {
        case “celsius”:
            if (temp) {
                if (temp < 9) {
                    temp = 9
                if (temp > 32) {
                    temp = 32
                if (latestThermostatMode.stringValue == ‘auto’) {
                    api(‘temperature’, [‘target_change_pending’: true, ‘target_temperature_low’: temp]) {
                        sendEvent(name: ‘heatingSetpoint’, value: heatingSetpoint, unit: temperatureUnit, state: “heat”)
                } else if (latestThermostatMode.stringValue == ‘heat’) {
                    api(‘temperature’, [‘target_change_pending’: true, ‘target_temperature’: temp]) {
                        sendEvent(name: ‘heatingSetpoint’, value: heatingSetpoint, unit: temperatureUnit, state: “heat”)

Once you get these things hooked up you can start playing with certain events. I will try to write blog posts once I got my new sensors at home. I ordered z-wave switch, z-wave 3 way dimmer, motion sensor and energy monitor. When I get this stuff to work I want to add some stuff so I can operate the garage door as well.

Moved my blog and I will try restart blogging here

It’s been a long while since I blogged here. After we moved to the US keeping up with our family blog, work and starting a new life here in the US, blogging here wasn’t a high priority.

Since we are more or less settled down and I have a little bit more time doing some technical stuff it might be a good time start blogging again.

As you can see the blog moved from www.hoekstraonline.net to http://matthijs.hoekstraonline.net. I combined the family blog, my blog and the blog of my wide (http://sandra.hoekstraonline.net/) to a multi site wordpress blog.

I did something wrong on the other blog on www.hoekstraonline.net and couldn’t get it working again, since i wanted to combine all 3 blogs in a single install anyway I took the opportunity to create the new blog, copied over the old posts and configured a permanent redirect (google loves that stuff) so google results and other links should still work.

See you around.

This is also a test post to see if the Jetpack social sharing plugin is working.

Bing.com April fools

This is one of the funny April fools jokes I found today. Most jokes aren’t that funny. But this one is subtle.

Go to http://www.bing.com/


Search for google. This will be the result.


Michael Kroll, Principal UX Manager from Bing explains the ‘Introduction Bing Basic’ in his blogpost 🙂

Oh and if you check the bing.com page the statues smile once in a while 🙂



Adding Videos from your SD card to your Videos library on your Surface RT

My daughter watches a lot of videos on the iPad (youtube and some local stored videos) today she wanted to watch the videos on the pink iPad (our Surface RT with pink touchcover). I have an SD card with videos inserted in the Surface but they don’t show up in the videos library. When you try to add the SD card to the videos library Windows complains it can’t do that because it’s removable media.

This blogpost shows the trick how you can do it. So my daughter now can happily browse videos from the Video app on the Surface RT and watch Dora, Zandkasteel and Barbie 🙂

Thank to @avalaxy (Leon Cullens) for the tip.

WiFi enabled my Roomba

A month ago I purchased my Roomba 780. At home we have a dog (German Sheppard) and we had to vacuum at least once a day (ok my wife did that :)) I thought; let me help a little in our household so I bought this device. At nights it automatically cleans the floor and when we leave the house we can manually start it as well by hitting the clean button or using the remote. So far we are really happy with it. Our daughter called the vacuum Toet! so that’s how we call it as well.

When searching the internet I found out the Roomba devices have a little connector and the specs for that connector are available as well (Roomba SCI Specs) There are also Bluetooth devices on the market which connect to this connector. When searching more I also found the folks of Roomba Wi-Fi Remote made a Wi-Fi connector. This was even more cool because you can connect the Roomba to your Wifi network (it also can be used in adhoc network mode) and you can potentially connect from the outside world as well. How cool would it be to connect to your Roomba from your work and see what the little guy is doing. So I ordered a Wi-Fi Remote on their site. They have a JSON/XML interface next to the web interface. So I am now planning to build a Windows 8 and Windows Phone app to control my Roomba remotely 🙂

Here are some pictures of the device:

WP_20130211_001 WP_20130211_003 WP_20130211_005 WP_20130211_007

Now I also need to figure out what kind of IP camera I want to attach to Toet! so I can watch when it’s working around the house 🙂

Where are all the Windows 8 apps?

We get a lot of questions from people they see less apps in the Windows 8 store than their friends and are wondering what’s going on. It’s pretty simple. By default the Windows 8 store only shows the apps which support your Windows Language preferences. So if you install a Dutch version of Windows the store only displays apps which support the Dutch language.

There are 2 ways you can show more apps. One is go to the settings in the store. Open the store app, go to settings, preferences. If you set the ‘Make it easier to find apps in my preferred languages’ to no the store will show you all apps published in your market.


What I prefer is only the Dutch and English apps. Make sure the setting shown above is set to Yes and go to the language settings of windows 8. (go to the startscreen, start typing language and select settings on the right side of the screen).


This is the language screen.


Add the languages you prefer.

Now the store will only display the apps in your selected languages. No Chinese, German and Italian apps in your list Smile

Btw, depending on your locationsetting the amount of apps might differ as well. The location setting in Windows determines what store you are searching for apps. (it doesn’t matter what region you set in your Microsoft account)