Apple homekit integration!

Discussion in 'Voice Control' started by ievolve, Nov 7, 2016.

  1. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    For those of you waiting for a great native mobile app for your iPhone and even iWatch and siri wired up to control your cbus stuff, look no further! I have written a plugin which will allow integration with CBus devices and the native "Home" application (apple homekit) just released in iOS10.

    There honestly wasnt any chance that Apple was going to play nice with CBus, and they have been so slow in bringing on compatible home automation products so I decided to take matters into my own hands.

    It is free and open source, would love to have some more collaboration on it if any of you are familiar with Javascript. I will try and post a video of it working here shortly.

    https://github.com/anthonywebb/homebridge-cbus
     
    Last edited by a moderator: Nov 7, 2016
    ievolve, Nov 7, 2016
    #1
    1. Advertisements

  2. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,040
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    That's great news Anthony.
    I'm sure a lot of people will be interested to give it a try.
    Looking forward to watching the video.
     
    DarylMc, Nov 8, 2016
    #2
    1. Advertisements

  3. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    Its been lots of fun playing with it. Tonight I added better dimmer support and also added support for motion sensors. This gives some nice automation support for things like scenes and other features built right into homekit. Its great to get all this native integration with the mobile/watch/siri/tv without having to build them out for each platform. I think people will like this.

    The issue right now is getting everything to a working state for someone who is not that familiar with CBus.

    First, I am using cgate for this integration since I figured that is the most prevalent gateway to CBus. So if you dont have that running somewhere, you will need it. The new windows installer will even set it to run as a service for you, very handy.

    Once you have CGate running you will need to run the code for the bridge. This is really easy to do on a mac. I've seen directions for windows and raspberrypi/linux, but they are not for the faint of heart. Once you are running the bridge you will need to make sure that if the machine you are running CGate on is not the same as the machine you are running the bridge on, you may need to configure CGate to allow remote connections.

    For the most part, if you have CGate going, and you can run the bridge, everything just plugs along seamlessly, its really super cool. Videos are coming soon(ish).
     
    ievolve, Nov 8, 2016
    #3
  4. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,040
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Hi Anthony
    What do think is the most convenient hardware to run for the bridge?
    For non Mac users.
    Maybe Mac mini?
     
    Last edited by a moderator: Nov 8, 2016
    DarylMc, Nov 8, 2016
    #4
  5. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    Mac Mini would probably be a great way to do it.

    I think raspberry pi 3 would be a decent way to go as well. If I was ambitious enough to build one up I could make a system image that was pre-installed and configured that someone could download and restore to their pi. If there was enough interest I may consider taking that on.
     
    ievolve, Nov 8, 2016
    #5
  6. ievolve

    abg

    Joined:
    Dec 25, 2007
    Messages:
    195
    Likes Received:
    1
    Location:
    Sydney
    This is brilliant. Thank you!

    Might even be worth buying an apple watch now....

    I have two networks - any suggestions on the best way to manage lights across the two?
    Looking at the code do you think it is feasible to place the clientNetwork in the accessories parameters?

    Update:
    Have modified the code and tested with the network number in the accessories rather than platform and it works so very happy. Now to move the application number....

    Anthony - these have turned out to be pretty simple changes as you'd know (mainly because your code is very clear to read so thank you). Happy to share but wan't sure if this was something you'd want changed and you could probably do it in 5 minutes anyway!
     
    Last edited by a moderator: Nov 9, 2016
    abg, Nov 8, 2016
    #6
  7. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,040
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Hi Anthony
    Raspberry pi 3 would be a good idea cost wise.
    From previous experience I think a UPS would be a good addition.
    If you can make an image would be fantastic.

    PM sent.
     
    Last edited by a moderator: Nov 9, 2016
    DarylMc, Nov 9, 2016
    #7
  8. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    I have a nice UPS built in to my raspberry pi 3 case with a lifepo4 battery that gives me about an hour of backup and will gracefully shut down the machine if needs be. It would be the perfect fit hardware wise for this project.

    @abg, very stoked you are enjoying it! If you want to send me a pull request I would gladly integrate them. Also, be sure you have v.0.2.0 as I have fixed a couple bugs that may give you fits.
     
    ievolve, Nov 9, 2016
    #8
  9. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    Finally got a video together of things in action:

     
    ievolve, Nov 10, 2016
    #9
  10. ievolve

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    90
    Likes Received:
    0
    Hi ievolve,

    This looks great. Had a look at the windows install and it looks a bit daunting. Thinking about buying a pi so would be very interested in an image you could install.

    Glen
     
    GlenF, Nov 10, 2016
    #10
  11. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,040
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Hi Anthony
    Nice work to get a video out so quick.
    The thread has been well viewed.
    I'm sure everyone is a bit interested what Homekit and Siri can do with CBus.
     
    DarylMc, Nov 10, 2016
    #11
  12. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    Thanks for the kind words. I will try and get another video out soon with all the siri voice integration. It is perhaps one of the most impressive wins that homekit integration gains you. I have seen really cool apple watch integration as well but dont have an apple watch yet. Planning on getting one and will update the thread with the watch integration as well. If there are any other specific things people would like to see, or questions you have, let me know and I will do my best to answer them.

    I'm contemplating building a device image, but perhaps even a pre-configured option with a raspberry pi hardware, nice aluminum heat dissipating case with built in UPS (using lifepo4 batteries), auto shutdown, auto boot once power is restored, and is a little more plug and play for people who just want to enjoy it "out of the box". We build boxes like these for my day job which deploys these "raspberrypi on steroids" builds as digital signage solutions that must run in mission critical 24x7 applications. Would be a good fit for this application if there is interest.

    Question I have is would people also want the raspberry pi image/device to also include CGate as well? Or do most people already have another machine running CGate 24x7? My first incarnations of this stuff connected direct to the CNI, but the feedback I got was that people preferred a CGate interface.
     
    ievolve, Nov 11, 2016
    #12
  13. ievolve

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    328
    Likes Received:
    4
    Location:
    Sydney
    I would be totally in for a pi image, I like building little boxes so would probably do that myself, but would love an image that makes that easier to do :-D

    My preference would probably be for C-Gate on the pi, as if I actually had a permanent C-Gate interface available on something like a pi, I would probably use it more. (I know I can do this already, just haven't got around to it :)) I would totally throw you a few Paypal shareware dollars for something like that too :)
     
    jboer, Nov 11, 2016
    #13
  14. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    Here is the video with some siri integration. Also showing of the 2 way link that keeps homekit in sync realtime with button presses on the wall switches
     
    ievolve, Nov 11, 2016
    #14
  15. ievolve

    abg

    Joined:
    Dec 25, 2007
    Messages:
    195
    Likes Received:
    1
    Location:
    Sydney
    Hi Anthony

    Back on to having a play with this - it's going to be very useful.

    Is there anyway to associate the entries in the config.json accessories list with specific Rooms or does each GA have to be 'moved' manually from the Default Room to a created Room via the Home app? Like you I have > 100 GAs so lots of rooms to assign....
     
    abg, Nov 12, 2016
    #15
  16. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,040
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    The response times seem very good.
    Would the Raspberry Pi be similar?
     
    DarylMc, Nov 13, 2016
    #16
  17. ievolve

    71monaro

    Joined:
    Aug 6, 2010
    Messages:
    65
    Likes Received:
    0
    Location:
    Adelaide
    I love this and would buy off you ievolve. I only have a PCU and basic lighting network. Can I then add a hardened Rpi (purchased from you with your software) to achieve this?
     
    71monaro, Nov 13, 2016
    #17
  18. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    @abg, unfortunately, they all get assigned to a "default room" and need to be assigned one at a time into your homekit rooms. It actually goes pretty quick because the groupid's are displayed there, so if you have a list you can fly through them. Still took me almost an hour though.

    @darylmc pretty sure it will be just as quick on the pi, I have ran my previous nodejs lighting apps on the pi and speed was never an issue at all.

    @71monaro I am still working toward having something for people who want turnkey. Not sure just what it will look like yet. I'm very happy with how solid things seem right now. Been running for several days without any hiccups. You will need to have a CGate install running somewhere on your network. I have considered including CGate on the PI image, but you will still need a CNI of some sort for it to connect to. I have an older CNI but it seems to get the job done just fine.
     
    ievolve, Nov 13, 2016
    #18
  19. ievolve

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    90
    Likes Received:
    0
    Hi ievolve,

    I have just purchased a pi to get this going so would love it if there was an image I could load. My preference would be to have cgate installed so it was all together.


    Glen
     
    GlenF, Nov 13, 2016
    #19
  20. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    0
    Location:
    Idaho
    For those of you playing with the plugin. Be sure to get the latest version of homebridge and my plugin, there have been some bugs fixed recently that improve the stability and performance of the integration. What is there as of today is pretty rock solid for me, even with ~100 devices.
     
    ievolve, Nov 14, 2016
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.