Apple homekit integration!

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

  1. ievolve

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    104
    Likes Received:
    1
    Location:
    Adelaide
    Haven't tried it yet but I'll use another flavour of RPI OS and report - this is the only other thing to try if others are running smoothly and they're not Jessie Lite users ....
     
    Ambro, Jan 3, 2017
    #41
  2. ievolve

    damian.dorbolo

    Joined:
    Jan 3, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Melbourne
    Hi Anthony

    just got this all setup tonight, and was pretty straight forward, so thanks for all your guides, and the system works like a dream !!

    only one thing i can see is i know you can setup groups to either be light or dimmer, but how about if you need them to be a bell press ? is there any way to do this, as my cbus integrates to an alarm system, so I currently have bell press triggers to make the alarm do certain functions.

    thanks in advance
     
    damian.dorbolo, Jan 3, 2017
    #42
  3. ievolve

    damian.dorbolo

    Joined:
    Jan 3, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Melbourne
    sorry what else could happen here as all of these bell presses are lighting groups, when a light is turned on it only stays on for one or two seconds then turns off, is there a way to do this in the config.jason file where the group has a timer on it??

    thanks in advance
     
    damian.dorbolo, Jan 4, 2017
    #43
  4. ievolve

    arrikhan

    Joined:
    Oct 16, 2011
    Messages:
    48
    Likes Received:
    6
    Location:
    Australia
    This is truly brilliant. Well done ...

    I'm assuming this isn't going to sit along side or work with the Wiser I bought many moons ago to achieve something close to what you have achieved with integration into Apple's homekit.

    I find myself wanting to integrate IFTTT etc. to control irrigation, windows, blinds ... but alas the Wiser only brings me an App to press the buttons myself and learn to code to automate the rest.

    Is the C-Gate Server the only way to communicate from Homekit?

    I have a standard CBUS setup with lights/irrigation/temp sensors/blinds/windows/fans connected and .. a Wiser. Do I chuck the Wiser and setup a C-Gate Server on a PI to leverage your great work? Or are there other ways?

    Regards,


    BenC

     
    arrikhan, Jan 6, 2017
    #44
  5. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi Glen
    I had a status indication not working when the command came from my motion sensor.
    The sensor was set to bring the light on to a level less than 100%.
    Also I had the GA set up as a switch not a dimmer in the config.json

    It is running very well for the last few days.
    raspberry pi3 jessie lite, remote CGate on Windows PC.
     
    DarylMc, Jan 8, 2017
    #45
  6. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Anthony
    I'd like to join everyone in thanking you for the excellent work you have done and really good instructions.
    Homebridge is running on raspberry pi 3 very nicely and having voice control of C-Bus is amazing.
     
    DarylMc, Jan 8, 2017
    #46
  7. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    TypeError terminates process soon after startup

    hi anthony,

    i'm so appreciative that you've built this plug-in! i've literally been waiting for this solution for years.

    as a developer i'm very keen to chip in and move this project further along, just as soon as i've got it up and going and have boned up on homekit and c-gate.

    unfortunately it didn't work 'out of the box' for me. i filed the following as an issue on github, is that the best place for it?

    thanks,
    simon

    ps. by the way, why are there two 'accessories' sections, one empty?

    ---


    I am running homebridge-cbus for the first time, so perhaps i've done something wrong, however when i start up, the process soon terminates with a TypeError

    full log:

    $ homebridge
    [1/8/2017, 9:18:51 PM] Loaded plugin: homebridge-cbus
    [1/8/2017, 9:18:51 PM] Registering platform 'homebridge-cbus.CBus'
    [1/8/2017, 9:18:51 PM] ---
    [1/8/2017, 9:18:51 PM] Loaded config.json with 0 accessories and 1 platforms.
    [1/8/2017, 9:18:51 PM] ---
    [1/8/2017, 9:18:51 PM] Loading 1 platforms...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing homebridge-cbus.CBus platform...
    [1/8/2017, 9:18:51 PM] [CBus] Connecting to the local CBus server...
    [1/8/2017, 9:18:51 PM] Loading 0 accessories...
    [1/8/2017, 9:18:51 PM] [CBus] CBus Client is listening to CGate on 127.0.0.1... Debug: true
    [1/8/2017, 9:18:51 PM] [CBus] Registering the accessories list...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Nook'...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Pendant'...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Sink'...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Pantry PIR'...
    [1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Scullery PIR'...
    Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 031-45-154 │
    └────────────┘

    [1/8/2017, 9:18:51 PM] Homebridge is running on port 51826.
    CBusStatusPacket {
    raw: '201 Service ready: Clipsal C-Gate Version: v2.10.6 (build 3145) #cmd-syntax=1.0',
    channel: 'controlStream',
    type: 'unknown',
    source: 'cbus' }
    /usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:313
    this.group = temp[2];
    ^

    TypeError: Cannot read property '2' of null
    at new CBusStatusPacket (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:313:26)
    at CBusClient._resolveReceivedMessage (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:253:23)
    at CBusClient._socketReceivedMessageEvent (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:200:10)
    at Carrier.<anonymous> (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:112:14)
    at emitOne (events.js:96:13)
    at Carrier.emit (events.js:188:7)
    at /usr/local/lib/node_modules/homebridge-cbus/node_modules/carrier/lib/carrier.js:24:12
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)


    for completeness, my config.json file is:

    {
    "bridge": {
    "name": "Kinkora",
    "username": "CC:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "031-45-154"
    },

    "description": "This is the My home HomeKit API configuration file.",

    "platforms": [
    {
    "platform": "homebridge-cbus.CBus",
    "name": "CBus",
    "client_ip_address": "127.0.0.1",
    "client_controlport": 20023,
    "client_eventport": 20024,
    "client_statusport": 20025,
    "client_cbusname": "SHAC",
    "client_network": 254,
    "client_application": 56,
    "client_debug": true,
    "accessories":
    [
    { "type": "dimmer", "id": "28", "name": "Kitchen Pendant" },
    { "type": "dimmer", "id": "26", "name": "Kitchen Sink" },
    { "type": "light", "id": "27", "name": "Kitchen Nook" },
    { "type": "motion", "id": "110", "name": "Scullery PIR" },
    { "type": "motion", "id": "148", "name": "Pantry PIR" }
    ]
    }
    ],
    "accessories": [ ]
    }
     
    simonhac, Jan 8, 2017
    #47
  8. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Simon
    Are you running CGate on the pi?
    I'm using remote CGate running on my PC for now.
    It's running great.
    Maybe that is worth a try.
    Here is a link to the script from my pi if it can be of any help.
    https://1drv.ms/t/s!AminzOc-NC4UgZVcVxZ5qabCwL5DHg

    There is a couple of things I wanted to mention about the instructions on Anthony's github page.
    I hope they are of help to someone here and I hope Anthony doesn't mind.

    Anthony did say it was important but of course I didn't listen well enough the first time.
    "It is important to note that if you are connecting to a remote c-gate server, you will likely need to configure c-gate for remote connections."
    I think the instructions should remove the word "likely".
    Here is a link how to configure CGate for remote connections.
    http://www.cbusforums.com/forums/showthread.php?t=628

    In my case I then opened Toolkit and connected the project to the network to get CGate running.

    "client_cbusname: (required) The name of your CBus network."
    I think this should be changed from "CBus Network" to "CBus Project name".

    "id: (required) The id of the device. Each accessory in CBus has one."
    This is probably obvious but I think if "id" was changed to "group address" would be clearer.
     
    Last edited by a moderator: Jan 8, 2017
    DarylMc, Jan 8, 2017
    #48
  9. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    problem referred to above solved. i had `tag-name-output=yes` in C-GateConfig.txt, whereas the default (`tag-name-output=no`) is a (current) requirement.

    it's working like a charm!

    anthony, you are a bloody legend!
     
    simonhac, Jan 9, 2017
    #49
  10. ievolve

    guyb

    Joined:
    Dec 29, 2016
    Messages:
    3
    Likes Received:
    0
    Location:
    Singapore
    Hi Glen,

    I bet the problem is that you have a digit in your CBus project name. There is a bug in version 0.5.0, which is fixed in 0.5.1 updated on Anthony's GitHub yesterday.

    https://github.com/anthonywebb/homebridge-cbus

    You might want to download the new version and try it out. The new version also includes the possibility to specify different network or application id's in the device's address, which allows it to speak to larger or mixed type networks.

    Cheers
    Guy
     
    Last edited by a moderator: Jan 12, 2017
    guyb, Jan 12, 2017
    #50
  11. ievolve

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    104
    Likes Received:
    1
    Location:
    Adelaide
    That did the trick !! - Thanks all involved, works a treat now.

    One question - would it be hard to use the same method of turning on and off a relay but instead calling it open and close for door operations? Saying to siri to turn on the door just doesn't sound right ;)
     
    Ambro, Jan 13, 2017
    #51
  12. ievolve

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Thanks Guyb, that sound exactly what my problem is. I will give it a go and report back. Thanks for all the help everyone.


    Glen

     
    GlenF, Jan 14, 2017
    #52
  13. ievolve

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Hi all,

    Thanks to Guyb for the above advice, it worked great (I also removed the numbers from the Cbus file just in case).

    Can I also say a huge thanks to Anthony for developing the homebridge cbus plugin - for those have not used it, it is truly amazing. Works perfectly and is amazingly responsive. I now have remote setup working with an Apple TV and the whole family are loving it.

    The setup takes a bit of mucking about but it is worth it in the end as it breathes new life into the Cbus installation. Total investment was $70 for the Pi (I already had the CNI) and I think I will now install an old Ipad in the wall because it works so well. Homekit is such a good product that has lots more potential that it has to be in Clipsal's long term interest to make Cbus natively Homekit compatible.

    Glen
     
    GlenF, Jan 19, 2017
    #53
  14. ievolve

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    I think it's important to understand the distinction between the real Apple HomeKit and HomeBridge.

    Homebridge is not HomeKit, it is in fact a HomeKit emulator.

    When HomeKit was released it was/is designed to be the central control system for all official HomeKit devices. Apple also published the interface API so developers could write their own front end user interface.
    Some time later Apple also released their own generic front end, and it is what now comes standard with iOS10.

    Now because the API was published to allow clients to be written, some enterprising folk reversed the thinking and used it to create a HomeKit emulator. There are a couple of different ones available, including the one discussed here, Homebridge.

    This means you can use any HomeKit compliant front end client (including the Apple supplied one) to connect to the pretend HomeKit (ie homebridge).

    The benefit of doing this is Homebridge is able to be setup and configured by anybody and as seen here, have device drivers written to talk to anything you want.
    This is not the case with the real HomeKit, getting a product certified by Apple is an unbelievably difficult and costly exercise, and in some cases not even possible. If this was easier then Homebridge would not have come into existence.

    So given this, what we have here is effectively a hack and not how Apple intended the HomeKit client to be used. My concern is that Apple will eventually stop any HomeKit client from communicating with non certified server instances, ie Homebridge.

    Now I'm as bigger hacker as anybody, and good on the Homebridge folk for thinking outside the box, but unfortunately this approach can never be the basis of a commercial products functionality or be sold to an end user because it is likely to just stop working one day when Apple slam the door shut. Especially when they realise the confusion that these emulators like Homebridge are creating with end users.

    As for C-Bus officially becoming a HomeKit device, well that is not for me to say, but having gone through the requirements myself, I can tell you that it is very very difficult and in my opinion unlikely.
    Just by way of an example of the requirements, all HomeKit products must contain HomeKit hardware (ie security communications chips) and be built in a HomeKit certified and secure factory. And that's about 1% of it.

    So anyway, enjoy it while you can, because my feeling is it won't last forever.

    Rohan
     
    rhamer, Jan 19, 2017
    #54
  15. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    interesting perspective rohan -- it absolutely is a risk, so i certainly wouldn't be promising this functionality if i was an installer.

    but i'm an optimist.

    homebridge (i mean the generic project, not homebridge-cbus) has taken on a life of its own -- literally hundreds of devices are now supported and thousands are using it. the more consumers that depend on homebridge and the more that clipsal/schneider appreciate the significance of homebridge-cbus, the more likely that we'll be able to chart a commercially viable path towards cbus/homekit integration.
     
    simonhac, Jan 19, 2017
    #55
  16. ievolve

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    The issue as I see it it, Homebridge and others like it are uncontrolled and insecure, two of the most important mandates Apple hold and promote.
    They want to make sure there is no way a HomeKit installation could be accessed or controlled by an unauthorised person.

    The real solution is for Apple to stop being so damn obstructive with their policies towards gaining information and access to HomeKit. Then more companies would be likely to get on board the official way.

    BTW there have even been attempts to manufacture universal style interface units that talk official HomeKit (with all the required hardware and security) on one side, and a more open access on the other, but Apple have stopped them.

    Anyway, I wish it was easier for everybody's sake. Perhaps Amazon echo will have an easier implementation path when it is eventually released here.

    Rohan.
     
    rhamer, Jan 20, 2017
    #56
  17. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Rohan
    Thanks for the information and warnings.

    I met with a forum member recently who has been using Amazon Echo for his C-Bus and AV gear.
    An extremely integrated home.
    He seems to like it.

    Here is an example of an approved Philips Hue bridge and what it retails for.
    I guess the market for C-Bus bridge is a lot smaller.
    http://www.apple.com/au/shop/produc...t-upgrade-bridge-for-current-hue-bridge-users

    As far as security goes it seems to me that Apple only controls from ios to the bridge.
    The Hue bridge is still available to the Hue app and the internet.

    I really hope for an approved 3rd party Homekit bridge.
    I'm using Homebridge on raspberry pi for now.
    Voice control with Siri is a great addition to C-Bus.
    I don't have to put my glasses on and navigate an interface.
    I don't even have to pick up the phone.
    Love it.
     
    DarylMc, Jan 20, 2017
    #57
  18. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    support for shutter relay added

    just a quick note that homebridge-cbus 0.5.3 has just been released and now supports the L5501RBCP shutter relay.

    what does this mean? you can now control your blinds with siri!

    next up is the L5501RFCP fan controller.

    (big thanks to everyone on this forum who provided very useful information that made adding the shutter relay relatively straightforward.)
     
    simonhac, Jan 23, 2017
    #58
  19. ievolve

    damian.dorbolo

    Joined:
    Jan 3, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Melbourne
    Hi Guys,

    ive just had a weird issue happen, and wondering if anyone has had the same

    i have added a few more cbus groups to the config.jason file. and when i do and restart the homebridge service, nothing in homekit works, does not show updates and sometimes comes up with no response.

    i have tried the following
    - delete persist folders
    - delete one cbus group at a time to see if its the cause
    - realod npm and homekit cbus
    - remove and add home in homekit

    the really wierd thing is that if i revert back to the old groups i have, everything works fine, if i add one extra group, or if i remove one and add a new one, it doesnt work

    the only thing that i can see is in the homebridge terminal, this error comes up when the issue happens

    CBusStatusPacket {
    raw: '401 Bad object or device ID. ' ,
    Channel: 'controlStream',
    type: 'unknown',
    source: 'cbus' }


    any advice would be appreciated
    Thanks, Damian
     
    damian.dorbolo, Jan 26, 2017
    #59
  20. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    Do you have a step-by-step manual so that I may get up to speed on the first one ? I was planning to use my house as a testing area.

    You never cease to amaze me at the innovations you produce.

    Since QNAP now has node.js server support, can I use my QNAP server ?
     
    tobex, Jan 26, 2017
    #60
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.