Monday, May 12, 2014

Curtains and Blinds with Vera Lite and Fibaro Shutter Relay

About two months ago, I started looking into home automation solutions as the condo my wife and I bought way back in February of 2011 was going to finally complete soon - and since it would be ours (and not rented from someone else), I figured I could finally do some fun projects to make it "ours"!

In comes Home Automation.

I wrote a couple of posts before here, here, and here in the lead up. What I didn't really touch on are curtains and blinds. I joined a Singapore-based Home Automation group on Facebook and some of the other members were discussing automated curtains. 

The way my condo is set up, we have two balconies (living room and master bedroom) and two normal windows (the two small bedrooms). Since were putting curtains in for the two balcony doors, it would be a good idea to automate them somehow. For the two normal windows, my wife and I were thinking of roller blinds. I figured, why stop at automating the curtains when I could take this opportunity and automate the blinds too!

I'll get into both solutions below, along with links to where I sourced the materials. I justified the overall expense with this simple fact: It was cheaper to source the motorized curtain rails and full roller blinds (motor and material) from China on our own than buy MANUAL curtains and roller blinds here in Singapore. Absolutely crazy, right?

Curtains

From the Facebook group I mentioned earlier, members were discussing curtains. After a little digging and prodding, I learned the motors for the curtains used by one of the members were manufactured by a Ningbo, China company named "Dooya". Their curtain solution can be read about here.

I found the specific motor I wanted to source was the Dooya DT52S - 'S' for "standard". This means there are 4 wires leading to the motor instead of 3.



Green/Yellow - Ground; Blue - Neutral; Black - Direction 1; Brown - Direction 2

The 'E' model of the motor comes with a single "live" wire as it comes with a RF remote control. This 'S' model doesn't have any of that fanciness, which is great because this gives the ultimate flexibility on how I want to automate the motor - i.e connecting it to a purpose-built shutter relay that connects to my home automation control center, the VeraLite. (As I wrote about earlier, the VeraLite is a control center for a Z-Wave-based home automation solution)

I went straight to Taobao to find a source. I did a random search for "DT52S", the model of the motor. Tons of results came up. I randomly chose one from a dealer based in Hangzhou, specifically 小殷智能窗帘馆. They not only sell the motors, but also the rails. 

Here's the link to the motor I bought. But, I specifically requested the 'S' model, and not the 'E' model - so be careful here!

We made a few phone calls to the guy who runs the shop, Mr. Li, to understand what kind of measurements we needed to do. Mr. Li was extremely helpful and friendly. Based on his coaching, I came up with the following measurement diagram and sent it over to him:

Living Room Curtains, 2 directions



Master Bedroom Curtains, single direction (curtain moves from the right)


Yes, the writing is mine. As you can see, it's been a while since I wrote in 汉字.

We made a conscious decision to only buy the rail and motors from China as we wanted to see and touch the curtain material in person - so that we're sourcing here in Singapore (and paying for it too!)

Overall, the cost to produce the rails and buy the motors (2 motors, 2 rails) came to about RMB 1,416 (~S$ 280). (This is before shipping). They charge about RMB 80 per meter of rail. The Motors were RMB 428 a piece. To put this into perspective, sourcing rails (boring manual rails) here in Singapore is around S$100 for 2 rails, at least that's what our curtain guy was charging). Shipping to Singapore was about RMB 680 (~S$ 136).

The key to connecting the motor to the VeraLite is this little relay: The Fibaro Shutter Relay (FGR221). (I didn't buy it from this link)


There are other competing products but Fibaro is a well known brand and I believe the Fibaro modules are among the smallest in the market. (You also pay a bit of a premium for this).

I sourced these locally in Singapore from a company named Domotics for S$95 a piece. Each one controls one motor. Wiring is simple. I ignore the S1 and S2 connectors as I won't be adding any physical switches. So the connectors I am interested in are: N for Neutral, L for Live, O1 for Direction 1, and O2 for Direction 2.

I went to my local hardware store to pick up some electrical wiring, a concealer box to mount to the wall, and some other nic nacs. The last thing you want is exposed wiring, especially with a 1-year old running around. Here's what the wiring looks like in the concealing box. The wiring coming from the bottom goes to the wall plug. From the top is from the motor. As you can see, I plugged the brown and blue from the wall into L and N connectors on the relay respectively. The smaller black and brown wires plugged into O1 and O2 are from the motor. That's it. Really simple. There are plenty of nice wiring diagrams out there so I won't attempt to make one myself.

Now, I realized my measuring was slightly off for my master bedroom. Seems I had to cut about 2 inches off the rail.

I had to take the rail apart. Inside is a steel reinforced rubber track with teeth that the motor turns.



An excuse to by a hack saw.


Cut.


 Back together.



Measuring to cut the correct length of the inner track.


Putting the clasps back on.



And it's back together!


Adding the Fibaro Shutter Relay to the VeraLite was pretty straight forward. There was one setting I had to make that wasn't very clear on the forums (I asked someone form the home automation fb group for guidance).


You have to set variable 10 to 1. This tells the motor to not try to be smart and turn off the "shutter positioning"function (yes, "1" means off. counter intuitive, I agree). Before I did this, when I pressed the button to open or close, the rail would stop several times, and rarely make it to the end. I set this variable, now it functions as it should!

(Sorry, in the video, I don't have the material yet)



Update: I now have the material. Here are curtains operated by the Aeon Labs MiniMote:


Blinds

While working on getting the curtain rails and motors, I started thinking about the blinds for the other bedrooms. The quote we got locally for manual roller blinds for the 2 bedrooms (4 roller blinds in all) was more than S$ 2000! I thought that sounded outrageous. I found that the same taobao dealer I was working with on the Curtain motors and rails also sold tubular motors for blinds. Also from the same manufacturer Dooya.

The motor we ended up going with is the Dooya DM35S. Link to the product on taobao is here.

After some consultation with the dealer, we decided to take the risk and have him supply the material as well as we felt it may be more difficult to source only the material locally without the roller. Due to the width of our windows, each window would require 2 roller blinds (thus 2 motors), making it a total of 4.

Below are the drawings with measurements I took and sent over.

(this time I didn't bother with the Chinese characters)

All in, the price we paid for all 4 motors and material came to RMB 3,023 (or approx SGD 606 - a freaking steal). Shipping to Singapore was another RMB 850 (~S$170) - actually, this shipping fee was a topup of the original RMB 680 as my dealer combined all into a single shipment.

The shipment looked like this:

Unpacking the roller blinds: (you see the rails for the curtains at the top of the photo)


Installation


Installation complete, now my turn to wire things up. As you can see, I added 2 boxes, one for each Fibaro Roller Shutter relay (one box was too small for both plus wiring)


Wiring


I tried to be professional by soldering the copper wires


Finalizing the wiring. As you can see, I decided to wire these up in series as I felt the load would be low enough to put both on a single circuit and wall plug. The wire going down at the bottom right of the photo is going to the wall.



And here we are! I connected the Aeon Labs MiniMote here too for ease of use.


Summary

All in I think it was worth the trouble of working in constrained spaces, wiring, etc. Good fun. All in, total cost was as follows:
  • Curtain rails and motors (x2) - S$280 | Source: Taobao/China
  • Blinds material and motors (x4) - S$606 | Source: Taobao/China
  • Shipping of the above two items from China - S$306 (ouch!)
  • Fibaro Roller Shutter Relays [FGR221] (x6) - S$570 | Source: Domotics SG
  • Aeon Labs MiniMote Z-Wave Scene Remotes (x4) - S$320 | Source: Domotics SG
  • Miscellaneous wiring, electrical boxes, etc = ~S$100 | Source: Local HW stores
  • Material for Curtains (x2) - ~S$800 | Source: Local curtain supplier
Total Above: S$2980 

Manual curtains and blinds here would have cost about the same, give or take. I think money well spent!

Oh, and I can be even more lazier with the Vera app for Android plugged into my TV.



(Note: You'll need a Z-Wave control center, like the VeraLite!)

Saturday, May 10, 2014

Setting up the Aeon Labs MiniMote with the VeraLite (UI6) to control Blinds

I motorized my blinds and curtains, but I realized it may be too complicated for some family members to operate. I decided to get a few Z-Wave remotes to assist.

I eventually settled on the Aeon Labs MiniMote due to it's size and features (control up to 8 scenes). (Special thanks to http://www.domotics.sg/)




Setting up is relatively simple. I ignored the instructions that came with the remotes as they were confusing (product of poor translations from another language to English?). I found this forum post that pointed me in the right direction.

Start by going to Add Devices.


Select the Advanced Z-Wave devices.


Finally press the Add one button to add it as a primary controller.


 Once pressed, the yellow light on the VeraLite will flash. At this point, find the "Learn" button on the MiniMote. Press that. You'll see several flashing lights on both devices. When the yellow light on the VeraLite goes solid, you're ready to continue.



Refresh the UI6 interface. You should see a new "Other"device, named something like "_MiniMote". I like to name all my devices, so click on the wrench.


Go to Advanced. Replace the name field with what you want. Then press the X button at the top right. That's it. (you'll need to reload your interface so the changes are saved)


Lastely, the MiniMote deals directly with Scenes. I already had several scenes configured in my VeraLite for my blinds and curtains. Click on the wrench again, then the scenes tab. Here you can easily select existing scenes to be run when a button is pressed.


Once you're done, and the interface is saved, you're ready to use the device!





Tuesday, April 8, 2014

Power Solutions

I have a goal - to get my sensors to run on AA batteries for several months at a go. We'll see if I can achieve that.


Tuesday, March 25, 2014

First batch of arduino parts received [Updated]



I posted a few weeks ago about a recent purchase I made on eBay for raw parts that would allow me to make my own sensors for my home automation project. I received a few items already.


What is pictured is the following:

I'm waiting or the rest of the items including the larger Arduino board for the base station, wiring, and other sensors. I'll post when I receive them.

Update on 26 March

A couple more parts came today.


Sunday, March 9, 2014

Prepping for Arduino Sensors with Vera (Z-Wave) Controller

I posted about my recent purchase of the Vera Lite Z-Wave controller the other day in a rather ambiguous blog title. Since then, I've been researching ways in which I can build my own sensors that would ultimately be much cheaper than buying ready-made Z-Wave sensors.

I came across this website that details a project that allows you to build your own sensors using Arduino, and it plugs directly into a Vera. On average, the sensors should cost anywhere around USD 10, but I'll see what the actuals will be after I get all the pieces.

My initial plan is to get the following sensors built:

  1. Temperature for each room of the house (5 or 6)
  2. Humidity+Temperature for the two bathrooms (more on this later!)
  3. Barometric pressure+Temperature for outside (for fun)
I thought about trying to locate most of this stuff in Singapore but I figured I'd end up paying more than double of what I would if I sourced from China myself (and not to mention the time it would take for me to drive around and locate everything!)

The above linked project site was nice enough to link to individual products on eBay, so I decided to dust off my old eBay account and get purchasing.

Phase 1 cost me just about USD 120 (or about SGD 160) for the raw materials. This should get me a good 8 different sensors. Compare this to getting a Z-Wave-enabled Fibaro Universal sensor at GBP 36, plus the cost of the actual sensor chip - I think going this DIY route will save quite a bit of money. 

Future Plans
I have some thoughts of what to do in "Phase 2". Building on the base, I want to do the following:
  1. Automated bathroom exhaust fan (using the humidity sensor)
  2. Automated plant waterer (using the not-yet-purchased moisture sensor)
I'll report back when I get the devices. Work can't start until I move in April or so any way..

Monday, March 3, 2014

Putting the pieces together in anticipation...

It's been a while since I posted here. Primary reason, I had a daughter last March. (my free time disappeared literally overnight). Now that we're getting settled, it's time to get back into the home automation game.

In anticipation to our upcoming move to our first home we'll own, I am ramping up and have decided on the Z-Wave protocol as I don't want to built my own everything from scratch, but instead I'd like to get a baseline on which I can build on top of.

Will I still hack around with the Raspberry Pi? I think so. More on that later.

The Base

As mentioned above, I decided on Z-Wave. (Other competing standards include ZigBee). I ultimately went with the Vera Lite controller that I kind of bought out of the blue the other day at the IT Show here in Singapore (it was discounted by 10%, but it's still more expensive in Singapore than elsewhere because it is Singapore).

The kit included the controller (the Vera Lite), 3 Fibaro dimmer switches, and a motion detector. The dimmer switches will be used for connecting some of my downlights to the network (and I am sure I'll need more later).

Lighting

I bought 12 LIFX bulbs a while back and they arrived a couple of weeks ago.


No, these don't talk Z-Wave, but that will be a fun project for me, see below.

As mentioned earlier, I'll be using dimmer switches (or normal switches) for my other lighting. Even though these switches are expensive (if they are Fibaro), the advantage is, they are small and should fit inside of the light switch socket in the wall (I haven't confirmed this yet with our new condo, so fingers crossed).

My LIFX bulbs will be placed in both ceiling lights as well as lamps, but the final configuration isn't yet confirmed (I still have about 3 not yet taken as I am struggling to find rail lights that fit E27 Edison screw bulbs. Tall order.

LIFX is planning to release an SDK sometime this quarter, they claim. Once they do, the hacking begins - I want to build a Z-Wave interface for LIFX, most likely using a Raspberry Pi with Z-Wave shield (it's a shame that it's bloody expensive though - more than the Pi itself!).

Aircon and other IR Devices

This is where the fun begins. I was thinking of continuing my previous project of the "ThermostatPi" (which I coincidentally posted about a year ago yesterday), making use of a Raspberry Pi and a USB Toy 2, but following a Singapore Home Automation forum on Facebook the last few months, a very interesting product out of China has stoked my interest, the Broadcom RM2. It's a proprietary IR blaster (i.e. that doesn't connect with any other Home Automation standard like Z-Wave), but the reviews promise it "just works" - something I am quite keen on. They are rumored to release an SDK for it in Q1 of this year. And this is where another fun project will come about as I plan to write a RaspberryPi interface to it, much like I plan to do with LIFX as stated above. The goal here is to control everything from single app (switching between apps is too much trouble and certainly not consistent with the whole Home Automation thing).

Curtains

I'm still researching this and will post more about what plan to do. It looks as though the mechanisms to control curtains is quite costly, so this may need to take a back seat for a while.

Saturday, March 2, 2013

ThermostatPi - Controlling airconditioning with the Raspberry Pi and USB IR Toy - First Release!

Finally got around to getting the first release of my current project up!

Code: https://bitbucket.org/cdrum/thermostatpi

It's called ThermostatPi and it makes use of a Raspberry Pi, a USB IR Toy 2 (see my library here), your bargain basement DS18B20 One Wire Temperature Sensor, some Blu-Tack, and a few other miscellaneous wires and such.

In it's current form, it monitors temperature, and allows the user through a web browser control the wall mount airconditioner over IR. The code contains a command line tool to store presets. (In my case, my air conditioner is complicated, and I couldn't extract individual button clicks, but instead, the complete configuration of whatever is on the remote at the time.



Software

I wrote everything in PHP. I used Foundation for the web framework. I used RRDTool for charting.

Right now, there are two major screens. First is the current temperature with historic graph.

The next tab is there the controls are shown.


 You see to the right are the last 6 or so commands run. I use SQLite3 to store the history. (I plan to add settings to the db as well down the road).

Using Foundation's alerts, I show immediate feedback after button presses.

It also works on Mobile, thanks to Foundation.



I have a cron running to update the history charts each minute.

Lastly, I use dyndns so I can access it from my mobile phone. Makes it simple to turn on the air con when I'm on the way home!

Hardware

This is pretty self explanatory. I have the DS18B20 chip plugged into the GPIO pins.


And lastly, the IR Toy is positioned to point at the air con using Blu-Tack. Thank goodness for Blu-Tack!


 Next Up

I want to start building some intelligence into it. I want to set a temperature, and have it attempt to maintain that temperature. We'll see how that goes.