Poor man’s automation - WeMO + Limitless LEDs

, posted: 29-May-2016 16:30

Home automation using a common platform such as the Philip’s Hue bulbs or the Wemo switchable plugs and bulbs is reasonably straight forawrd.  I’ve got a mix of Limitless LED light bulbs and Wemo switches, which makes it more complicated, but can be achieved using some custom software.

My goal was simple.  My outdoor light, main hallway light and kitchen light are all Limitless bulbs.  The lights in my lounge and behind my main computer are on Wemo switches.  I wanted a solution whereas all these lights would switch on based on sunset, and then switch off again at a specific time.  The reason for the switch off, is if I’m away on holiday, the lights need to turn off on their own; if they are already off, the system would just exit.  Since it’s rare for me to be out really late, I picked 2am as the switch off time.

I like this solution because I’m often home after dark, plus if the wife and I are out at a function, we don’t have to fumble around in the dark looking for our house keys.  The added benefit is the security of it looking as though someone is home.

The solution I came up with was all reasonable straight forward, but did take a lot of trial and error.

Firstly, I needed a machine that was always on at my place.  My newly installed HTPC running Windows 10 would be the perfect candidate.  I could’ve easily achieved this with a low powered PC such as a Raspberry Pi, but I needed a programming language (.net) and platform I was already familiar with.

To ease deployment and maintenance, I opted for a console application.  If I was going after always on and super reliable, it would’ve been a Windows service.

The process works simply, as follows:

  1. At 4pm everyday, using Windows Scheduler, my console app boots up and queries the Sunrise-Sunset API.  This takes a lat/lng parameter, giving me the exact sunset time at my place.  There’s lots of extra info it provides (such as sunrise) but these aren’t required for my application.

    The reason I like this is it will automatically change the time in summer and winter, meaning no configuring at different times of the year.
  2. The console app sleeps until it’s time to run.  When it wakes up, it fires off a UDP packet which the light bridge is listening for to turn the lights on. For the Wemo switches, it connects to each one and fires a SOAP request to switch them on.
    1. I was using the library from Barnacules which uses UPNP to find the Wemo switches, but for some reason, it just doesn’t work on Windows 10.  Since I only have the two switches, I set them to reserved IPs in DHCP, so I always know where to send the on/off commands.
  3. Once the lights have been switched on, the console app goes to sleep until 2am, where it fires off commands to switch the lights and Wemos off.
  4. I log everything to a basic txt file for diagnostic reasons.  If I was being super diligent I’d store this to database.

Happy to share the source code with anyone who wants it, just fire me an email, nate at 3bit dot com.



App Review: WorldRemit

, posted: 25-May-2016 11:07

Transferring cash overseas hasn’t really been something I’ve been interested in until recently.  With my younger brother now doing the Kiwi right of passage OE, it was time to hunt down a way to quickly and easily send him money if he needed it.  The first thing I did learn is that pounds vs dollars exchange rate is not doing us any favours. Ouch.

An app, for me, is essential.  With the first transfer being free, WorldRemit was my first point of call, and works all easily from my Nexus 6P.  I reached out to them, and with a small amount of provided credit, I tried out my very first transfer.

Firstly, I am not a big fan of an app being a heavily crippled version of the full website.  A great app is one where I can accomplish just about everything I could, instead of using the website.  To test WorldRemit out, I signed up using just the app.  It all worked, and all the tasks I use are in the app – checking what a transfer will cost with the current exchange rates, initiating a transfer and then seeing a log of what’s been done.

Receiving a transfer can be done in a variety of ways, and are really dependent on the destination.  I tested sending money to Uganda (better than to a Nigeria prince, but barely) and was given these options:

2016-05-01 12.30.09

Picking a recipient is also quick:

select recipient

Once the recipient is selected, the final confirmation is shown which allows you to do the transfer:

transfer deets

(I forgot to put in the promo code before taking the screenshot, there was no transfer fee).

On the next screen, I loaded in my credit card and the money transferred almost immediately. Easy.

My only gripe with the process was a lack of communication when a security issue comes up.  While doing this review, and not long after this transfer, my account was locked.  It seemed that my transfer from my new account to a user in Uganda had raised red flags, and their automated security processes had locked me out.  While it is impressive that WorldRemit do take security seriously, a quick email to me as the customer would’ve saved a few days of head scratching.

Other than that it was all quick, easy and painless.  Everything you need from a money transfer app.

Disclaimer: WorldRemit provided me with $20 credit to try out the transfer process, which I transferred to one of their employees.  This review was not paid for.



eWay response codes as a file

, posted: 2-May-2016 16:29

Anyone who has used the eWay payment gateway for processing credit cards, will have come across this.  If there is an issue, rather than alert you with what the issue is, the eWay API will give you a five digit response code, which you then have to decipher.  Not helpful.

Chatting to their helpdesk today, they don’t provide all 235 different codes as a simple download (too easy I know), so using some regex magic from their documentation, I’ve dropped them all into one easy to import CSV file.

Import into your database of choice, and more meaningful eWay error codes are only a query away!



International podcast conference this weekend

, posted: 10-Feb-2016 17:26

Asia-Pacific-Podcast-Conference-logoI’m often a guest on the NZ Tech Podcast, and one of the founders, Paul Spain, is running the first ever Asia Pacific Podcast Conference.

The first international podcast conference in the region hits Auckland this Fri/Sat. Features an incredible lineup of speakers representing podcasting, radio, TV, marketing and communications. Do you know anyone who should be there?

With a massive line up of 12 speakers from all sides of the podcasting world, it’ll be a very informative two days.  If you are interested in podcast, or run your own, this will be a great investment.

(Even if you can’t make it, you can buy tickets to stream it online… perfect!)



Is the Nexus 6P the perfect Android phone?

, posted: 17-Jan-2016 13:18

Continuing on in my Huawei fanboyism (last blog post was about the Huawei G8), I couldn’t help but also review the Nexus 6P, which seems to have been crowned the best Android phone on the market right now.  Much to my surprise, all the online reviews I read raved about this phone, so I had to see what all the fuss was about.

huawei-nexus-6p-screenshot

First thing you notice about this phone: it’s big.  At 5.7” it’s definitely a phablet, and a smidgen bigger than the iPhone 6s Plus (5.5”). Screen is AMOLED, protected by Gorilla Glass 4, with a resolution of 1440 x 2560 (518 ppi).  Unlike Huawei’s other phones, this one runs pure Android (Marshmellow).  Processor is a quad-core 1.55 Ghz Cortex-A53 with 3GB RAM.  Camera is 12.3MP, and powering the show is a massive 3,450mAh battery.

Boring specs out of the way, what’s the good stuff this phone has to offer?

Speed. Coming from Samsung’s TouchWiz and Huawei’s Emotion UI, the pure Android experience is dreamy.  Camera opens quickly, swapping between apps is quick, and turning WiFI, mobile data and any of the other features on and off is quick.  If you switch developer options on, you can make the animations even shorter.

Camera. Best camera I’ve ever used, especially in low light. This photo I took at New Years, and even after I’d had a beer or six, it’s pretty clear.

IMG_20160101_003556

One annoying feature of the camera is if you swipe right to turn on the camera, after you finish recording a video, the phone takes you back to photo mode. 

Finger print reader. This is located on the back centre just under the camera.  It’s pretty quick to respond, and its much better than typing in a pin or swiping a pattern to unlock your phone.  You can also setup smart unlock, which means the phone won’t require a finger print if you’re at the office or at home.

Power. This phone doesn’t have your stock standard micro USB, but has an USB Type-C connector.  At the moment, this is a double edged sword: on one hand, you can get up to seven hours of use after 10 minutes of charge (haven’t test this yet, though it’s all over their marketing collateral).  The downside is because it’s not so common, if you forget your charger, you’re not going to be able to find someone who has a spare.

Capture

There must be some bad stuff: You can’t remove the battery, and you can’t add a memory card to get more storage.  Some reviews have talked about not liking the protruding camera on the back (I don’t think it’s much of an issue) and the fact it doesn’t support wireless charging.

All in all, I think this is the perfect Android phone.  The formula that’s been a success if a good form factor, speedy hardware with a big battery, paired with pure, no frills Android.

I liked it so much that I bought my own 64GB version the day I returned the review unit back to Huawei.

IMG_20160111_185217

No more phone reviews after this I promise.



nate's profile

 


I'm Nate Dunn, and I work for 3Bit, own Tuihana Cafe, and am a moderator here at Geekzone.

Use Autotask and Xero? Sync data between them with My Accounting Toolbox.

Use Xero and SagePay? Get your invoices paid faster using HostedPay.

 

Disclaimer
The views and opinions represented on this blog are personal and belong solely to the blogger and do not represent in anyway those of 3Bit Solutions Limited or any other company.


Latest posts

Poor man’s automation - ...
App Review: WorldRemit...
eWay response codes as a file...
International podcast conferen...
Is the Nexus 6P the perfect An...
Review: Huawei G8...
Review: Huawei watch...
What does your vehicle cost to...
LG’s 4K Ultra HD OLED TV...
Join me in Queenstown and Inve...