Tag Archives: Apple

Homebridge, the secret sauce to making HomeKit awesome

As mentioned in the previous post, my HomeKit setup is made up of quite a few devices. Many of these are not HomeKit compatible out of the box; they are either too old, or the manufacturer chose not to add HomeKit support. Homebridge magically makes all these available in my ecosystem as if they came with 1st party HomeKit support.

Homebridge logo

Homebridge allows you to integrate with smart home devices that do not support the HomeKit protocol.

Installation

It may be scary for the non technical person out there, but it should be. Homebridge is surprisingly straightforward to set up. I did it on a (very old) Mac Mini and I found the documentation to be accurate and up to date. As it’s usually the case, developers strictly provide installation guides for their own work, rather than for all the dependencies. Luckily Homebridge only has one dependency (Node.js) so this steps should not take long for you to complete. (I recommend you follow the official instructions, but if you’re in a hurry, you can try the steps below)

Node.js

First check that you don’t already have node installed. Open a Terminal window and run the command below. You need to see a result that shows v4.3.2 or greater.

node --version

If you don’t have Node installed, proceed with the installation by downloading it from here. Follow the installation instructions and then run the command above one more time to make sure you’re ready to install Homebridge.

Homebridge

Installing Homebridge is relatively straightforward. Open the Terminal app and issue this command to install the node package:

$ sudo npm install -g --unsafe-perm homebridge

Still in Terminal, move to your home folder and try running homebridge. You’re very likely to see a message like the one below, followed by a QR code and a HomeKit code. Ignore these for now! 

$ homebridge
No plugins found. See the README for information on installing plugins.

Rather than adding the bridge to HomeKit, you should take the time to create your very own configuration:

$ nano ~/.homebridge/config.json

Depending on the devices / plugins that wish you to add, paste the following:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "989-98-989"
    },
    
    "description": "This is an example configuration file and you should make sure to replace this description and the pin info above with something else",

    "accessories": [
        {
            "accessory": "TV",
            "name": "Panasonic",
            "description": "Lounge TV",
            "ip": "192.168.1.100",
            "maxVolume": 13
        }, 
        {
            "accessory": "Onkyo",
            "name": "Receiver",
            "ip_address": "192.168.1.111",
            "model" : "TX-NR509",
            "poll_status_interval": "900",
            "default_input" : "sat",
            "default_volume": "35"
         }
    ],

    "platforms": [
        {
            "platform":"BelkinWeMo",
            "name":"WeMo Platform",
            "ignoredDevices":[  
            ]
        }
    ]
}

Feel free to replace the description above with whatever you like. Just make sure you keep the quotes and the file contains valid JSON. If in doubt, use a JSON validator website to check the config.

Important: change the pin number above with whatever number you wish that matches the pattern provided (3 digits, 2 digits, 3 digits).

The “name” you see above is quite useful: Siri will use that to perform actions on your device. For example, I can say “Hey Siri, turn off the Panasonic” and Siri will switch the TV off.

The accessories and platforms are the main types of plugins that you can add. Simple things are usually just an accessory. You’ll see that each homebridge-plugin has its own configuration snippet that you will end up adding to the config above.

In my case, to add the TV accessory above, I did the following things:

 $ npm install -g homebridge-panasonictv
  • I then added an accessory to my configuration file
{
       "accessory": "TV",
       "name": "TV",
       "description": "Livingroom tv",
       "ip": "192.168.178.20",
       "maxVolume": 15
}

If you’re not familiar with code or JSON, think of the “accessories” (or “platforms”) line as a parent for multiple accessories (platforms), that are separated between each other with a comma. Don’t forget to use the JSON validator website when you’re not sure you added your accessory or platform right. The square brackets indicate a collection or siblings (multiple accessories separated by commas). The curly brackets simple encapsulate an accessory. Pay attention to how the TV and Onkyo accessories are grouped together inside the “accessories” parent.

You can add as many individual accessories (platforms) as you wish but remember to install the corresponding plugins first.

To recap, I have installed node, homebridge, and some plugins. I then updated my config file with my own settings for the plugins I selected, so it’s time to finally start homebridge:

$ homebridge

If all the stars are aligned, you should now be looking at a QR code. Launch the Home app on your iOS device (and now even on your Mac), tap the + button and then select Add Accessory. Follow the instructions and pair the Home app with your Homebridge installation.

Homebridge screenshot from the Home iOS app

Congratulations, you now have a working HomeKit bridge that can breathe new life into old tech!

HomeKit, a mini series of posts describing my setup

I often find myself talking to friends about my HomeKit (home automation) set up, that I’ve been building up over the years. Quite often they are curios about aspects I now just take for granted.

For this reason I’m considering writing a mini series to cover how everything comes together.

I’m happy to take questions, so feel free to get in touch.

Next up: The main components in my HomeKit setup

Apple Wishlist from a New Zealand Customer

I live in Wellington, New Zealand and I own a truckload of Apple products. This is my wishlist of things I wish Apple would start doing.

iPhone & iPad

  • Visual Voicemail. I get that it may be up to the telcos, but I’d love to know that lots of pressure is being put on them to add support for this feature.
  • TV app
  • #images support for iMessage when the preferred language is Te Reo.

Apple Watch

  • LTE. Again, I realise it’s probably our telcos being slow to update their tech stack, but I wonder if they get the same lead time as their Australian counterparts.

Apple TV

  • TV app. Once you use it, it’s hard to go back to another interaction paradigm.
  • Siri support. Guess what, Siri understands us even when we use an Australian Apple Id and a cheap VPN. How come we have Siri on iOS, and watchOS, but not on tvOS? Even Siri on macOS works…

HomePod

  • Surely they know we use the same plug and voltage?!

Grab bag

  • Apple News. I am a registered Apple News Publisher, I can see Apple News in the Today View, so why can’t we have the News app?!
  • Public Transit support in Maps (thanks for Flyover, though).
  • Ability to purchase TV Shows.
  • … an Apple Store. Sending Macs and iOS devices to Sydney for repairs is super painful and not very well aligned with the Apple Green strategy. Authorised repair agents often can’t help (e.g Apple Watch is a no go).

What have I missed? What’s on your list? Head off to twitter to tell me how naïve I am.

Apple needs iMessage on Android

I believe Apple needs to build iMessage for Android. They have lots of reasons not to build it but I believe that have at least one really good reason to do it.

Apple has already acknowledged Android’s importance by building Apple Music for Android (I won’t count the Android to iPhone migration app). This was a sound business decision, the same was building iTunes for Windows was a necessary move. The sheer number of Android users will bring about more revenues and will help prevent services like Spotify from generating a lock-in effect for the hoards of people moving from Android to iOS.

iMessage is different, though. iMessage does not generate any profits (yet), and has simply been a value-ad for the iOS (and Mac) customers. They could have continued down this path, but something changed recently: Apple has doubled down on their fight for privacy. Tim Cook’s resolve and public appearances arguing against FBI’s request to build a backdoor in iOS is unprecedented. He even gave the first ever interview from his office on 1 Infinite Loop.

No other player in the space advertises privacy as a core product “feature”. Apple needs it not just because it is a differentiating factor, but because they truly believe this is the right thing to do for their customers.

The fact of the matter is that Apple’s customers interact with people on other platforms all the time, and not all the apps they use to communicate with their friends on non-Apple platforms are secure. Sure, WhatsApp provides end-to-end encryption, Telegram does too, and so do many other apps. But none of these apps are controlled by Apple.

Building iMessage for Android will give Apple the ability to tell its iPhone customers that all their communication with their family and friends can be secure.

There’s an argument to be made, that for this to be completely accurate, Apple would also need to build iMessage for the web.

A bonus reason (speculation), is that iMessage is one step away from becoming a transaction platform (much like WeChat). Person-to-person payments could be one such type of transaction. In order to be successful, such a product needs to be available on as many devices as possible, thus making Android impossible to ignore.

p.s. If iMessage is to be added to Android, then FaceTime will most likely be added, too.

TV Wishlist

I’ve owned an Apple TV for a few months now (I have a Dev Kit unit). I’ve coded for it and I’ve been enjoying it a lot more than I had anticipated. Here are some of the things I’d like to see in the upcoming iterations of the software / hardware.

Accessories for the USB-C Port

Camera

I’d buy a camera compatible with the this new Apple TV in an instant. I’d mostly use it for video chat (FaceTime, Skype, etc) but I can see how some other types of apps could use it too (Snapchat, Livestreaming a video podcast, etc).

Playroom / Kinect style games could also benefit from being able to plug in a video capture device.

Bluetooth is not an option because the camera would needs its own power source.

Game Accessories

This port could also be used for a number of game accessories. From Dance Dance Revolution mats, to Steering Wheels for your favourite driving game.

Web Browser

My reason may be different from yours. If you ever tried setting up an Apple TV in a hotel room, you probably know how annoying the whole log-in via a browser window situation can be.

Search APIs

Apps could be so much more powerful if they could tap into the Siri Remote search capabilities. Search is available to some video streaming services, but I think many more apps could benefit from such a feature. Here’s an example: “Siri, play a 10 minute summary of the new on Reuters”.

Picture-in-Picture

I’d love to be able to watch a film and then launch a Wikipedia or IMDB type app and interact with that app while the movie is still playing.

It would be great to be able to watch some live sports while shopping on Gilt, or browsing my next holiday destination on AirBnB. Anyone can get distracted during a game of cricket, surely.

New Remote

I’m one of those people who watch TV in the dark. Because of this I find myself holding the Siri remote “wrong”. I’m wishing for a less symmetrical remote that I can pick up an instantly know which way I’m holding. I also want a trackpad that is either less sensitive or is a bit smarter and doesn’t activate until I’m holding the remote with a tight grip or is able to detect accidental touches.

I’m hopeful

The reality is, that until the things above are implemented, the Apple TV will have to be shared with some other device. In my case, the couch device of choice is my iPad.

It’s likely that Apple prefers this, but they are also the one company that would be very happy to cannibalize its own product rather than wait for someone else to do it. Come on Apple TV, kick my iPad off the couch and turn it into my bed-side device.

3D Touch vs. Long Press

Apple announced the new iPhone 6S line at their September event. One of the tent poles of their new iPhones is 3D Touch, a hardware feature that provides “depth” to touch interactions. An argument can be made that this feature can be replicated by a Long Press (a gesture that is already available).

Interestingly enough, almost all the interactions demoed during the event could be built today, using a UILongPressGestureRecognizer. Even the taptic feedback could be faked with a vibration.

Here are some of the differences between the two gestures that I can think of.

  1. Resting a finger on the screen could mis-fire a Long Press, but not a 3D Touch
  2. 3D Touch can provide instant gratification. Long Press gestures are defined by a minimum touch delay, therefore they would be laggy in comparison
  3. It would be very difficult to implement an app with multiple Long Press gestures, but it would be straight forward to mix a Long Press gesture and 3D Touch
  4. Long Press does not provide depth. Games can benefit from using this feature

Neither 3D Touch, nor Long Press gestures are discoverable. That is potentially why we have not seen many Long Press implementations this far. Looking at the Apple Music app, the Long Press gesture (on a For You playlist for example) opens the overflow action menu. It will be interesting to see if 3D Touch replaces that, or augments it in some way. Even the Instagram implementation doesn’t really “need” 3D Touch to offer a preview of the selected photo. A one second tap could provide the same functionality, albeit with a bit of a delay.

I’m thinking of an analogy with the home button. Pushing it down twice takes the user to multi-tasking. Tapping it twice invokes the “reachability” which makes the screen slide down. I often forget that the latter feature even exists… Long pressing an app’s icon will compete with the gesture that invokes “wiggle” mode. It will be interesting to see if users will be confused by the two gestures.

I have a feeling that many developers will start implementing Long Press gesture fallbacks for 3D Touch and that more and more apps will start providing Peek + Pop behaviours in their applications. This alone can be a huge win for many users out there, as long as the developers don’t start hiding essential functionality behind a gesture that I believe is not very discoverable. (Did you know that a Long Press on the back button of OmniFocus takes you to the app’s home screen?)

Notes:
I have not used an iPhone with 3D Touch yet (pre-ordered mine yesterday) so many of the things above are just guesses.

The one fear I have is that the 3D Touch edge-screen-swipe multi tasking gesture will interfere with the back navigation gesture. I sure hope I’m wrong…

Deciding on which iPhone to Buy

I bought a new iPhone today. My current one is damaged, but to be honest with you, I probably would have upgraded anyway. Here’s how I decided which iPhone to buy.

iPhone 6S

The choice was between the iPhone 6S and the iPhone 6S Plus. I have never owned a phone as large as the iPhone 6S Plus and I sometimes find even the screen size of the iPhone 6 to be too large for me.

I considered the 6S Plus because of these factors:

  • Optical Image Stabilisation for both Photos and Videos
  • Longer battery life
  • With a screen that large, it could replace my Kindle

In the end I bought an iPhone 6S because of these reasons:

  • Easier to handle single-handedly
  • More comfortable in my front pocket

The two things above I will be doing a lot of and I just don’t want to have to pay attention to how I handle the phone. The size of iPhone 6S Plus would make me be too aware of how I handle the device.

I have no doubt that the iPhone 6S Plus is a superior phone. Sometimes though, the more pragmatic choice prevails, even when it’s not a matter of cost. There are people who have to have the best, and to them I say: enjoy your iPhone 6S Plus.

Quick thoughts on the  Watch

Apple will announce in just a couple of days more details about the  Watch. I decided I’d join the bandwagon and comment on it. 

Why not just use the iPhone?

In order to answer this question, I will first look at our use of the iPhone. During WWDC 2014, Apple introduced iOS 8 and its interactive notifications. These notifications are supposed to let you “stay focused while you stay in touch”. The problem is, in order to actually get anything done, the number of actions required of the user is surprisingly high. 

  • Get the phone out from the pocket
  • Swipe the notification down
  • Tap the action 
  • Authenticate yourself (Touch ID helps but requires a recent iPhone)

Let’s now speculate about the steps required to perform the action using the  Watch. 

  • Flick the wrist
  • Tap the action

The benefits are clear: this is not just more subtle but it also comes with less friction. For as long as the watch is on the wrist you are always authenticated. A simple flick of the wrist can show you a glance of the event and seamlessly transitions into an actionable notification.

What does Apple mean by personal?

Let’s look at some potential use cases if you become an  Watch owner. You’ll soon be able to:

  • Pay for things
  • Unlock doors
  • Bypass authentication to interact with your apps
  • Identify yourself when you jump in your car (and let it update its setting to match your preferences)
  • Quickly communicate with your friends
  • Do all the above in a subtle and painless manner
  • Get access to parts of your health information 

All of the above can be done easily and with litte to no friction. Arguably, your iPhone can perform all of the above, but the way it does it requires a significant amount of steps and planning. 

Having a device that is always on, always there, always ready to be my valet, is why I think this will be the most personal gadget Apple has ever built. 

Will I buy one?

If it will be as easy as it sounds to interact with, then I might find myself interacting more  often and more promptly. This is the kind of value that will make me want to own one. 

Cocoaheads Wellington – Kick Off

I’m proud to announce the formation of Cocoaheads Wellington. For those who are not aware, Cocoaheads is an international Club for Cocoa (iOS & Mac) developers and designers.

The gatherings happen every 2nd Thursday of the month, from 7pm to 9pm. They are usually followed by a trip to a nearby restaurant or pub.

The first meeting will take place on the 12th of February at the Trade Me offices in Wellington. If you’re a Cocoa Dev / Designer then you should confirm your attendance here.

I intend to outsource the location. I’m currently hoping to convince one of the local Universities to host, but maybe another Wellington based organisation would be keen to put their hand up? If you know of any potential venues then please reach me via Twitter.

In terms of structure, I will propose when we gather that we break up the agenda in 3 parts:

  1. Follow up on the previous session
  2. Presentations (five to ten minutes each) on pre-agreed topics
  3. Q&A, tips or tricks, current issues or problems to ask the audience about

If you’re passionate about iOS or the Mac, you are keen to share your knowledge or learn from others, you live and breathe development or design, then I hope to see you there!