Apple homekit integration!

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

  1. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I love using the Home app and Siri voice control.
    I think it is great.
    Once you have a large home set up and maybe a stack of automations.
    To me it is poorly implemented if you cannot back it up.
     
    DarylMc, Dec 26, 2017
  2. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Previously it was mentioned Apple may not continue to support software bridges.
    I haven't got a link but if you read around Apple seems to have more recently suggested they will continue to support them.
    That's a good thing for Homebridge CBus users.
    I'm really loving the plugin and aside from me tinkering around it has been very reliable.
     
    DarylMc, Jan 14, 2018
  3. ievolve

    Brenda Selwood

    Joined:
    Jan 16, 2018
    Messages:
    4
    Likes Received:
    0
    Hi,

    Firstly, thanks for a great solution.

    It took me a little while to get going, the prerequisites for node weren't playing nice, but I had it mostly worked out when I came across the homebridge raspberry Pi guide which sorted me out.

    Then I had to change the interface to my custom home theatre app which was talking direct to the CNI. It's now talking cgate alongside the homebridge app.

    Happy days! Any chance for an interface to the air con thermostat ?
     
    Brenda Selwood, Jan 16, 2018
  4. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @Brenda Selwood
    What is the AC setup?
    Do you already use some remote method to change temps?
    On and off with CBus ELV relay works nice for me.
    Most AC manufacturers will have an interface board option.
     
    DarylMc, Jan 16, 2018
  5. ievolve

    Brenda Selwood

    Joined:
    Jan 16, 2018
    Messages:
    4
    Likes Received:
    0
    It's a Carrier reverse cycle ducted aircon. I replaced the standard controller with a C-Bus Aircon Thermostat (5070THPR with relays) plus a 4 channel changeover relay for the dampers. It uses RWG wiring and works fine. At some point i'll grab the non-relay version for downstairs.

    I was hoping to get it going with homekit-cbus.

    I haven't yet written the code to control it remotely, I haven't had much of a look but you can't change the damper relays with a simple cgate ON/OFF command, the thermostat changes it back within a minute, same deal if you hook the relays up to a c-bus switch.
     
    Brenda Selwood, Jan 16, 2018
  6. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @Brenda Selwood
    I have never used that product.
    If you have it set up Homebridge CBus can find all the CBus group addresses at startup and sends them to a file my-platform.json
    Using that info and looking through the unit dialogue in CBus Toolkit I think you should be able to setup some switch accessories in Homebridge CBus config.json to operate the AC.

    So the zones operate from the thermostat correctly?
    If the zones can't be closed by CBus I would check the thermostat settings in Toolkit.
    Keep in mind you don't ever want the plant running with them all closed.
     
    DarylMc, Jan 17, 2018
  7. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Cbus thermostats work on the aircon application $AC and has a specific protocol that is not lighting compatible. Even though the dampers can operate on the lighting protocol you can't control them directly as the aircon app will just override whatever you do (as you found out). To get this to work, homebridge would have to support the aircon app which is non trivial. You could just remove the damper zones from the aircon app and control them yourself, but then you couldn't control them via the thermostat and loose the ability to set individual temperatures for each zone. You would still have no way of turning the aircon on and off though. If you have a logic engine you could write some simple code use lighting group addresses to control the aircon app.
     
    Ashley, Jan 17, 2018
  8. ievolve

    Brenda Selwood

    Joined:
    Jan 16, 2018
    Messages:
    4
    Likes Received:
    0
    I've got homekit-cbus working fine with the lights.

    I can now control the thermostat via C-Bus with c-gate. You can't control it with On & Off commands. So unless homebridge-cbus is specifically coded for the c-bus aircon commands, I don't see it working.

    This is from the c-gate manual (extremely cut)
    AIRCON SET_ZONE_HVAC_MODE app ward zone-list mode raw-flag setback-enabled guard-enabled use-aux-level type level aux-level
    In my case type=3 (reverse cycle aircon)
    Mode - 0 = off, 1 = heat, 2 = cool, 3 = heat / cool, 4 = fan
    Level = Temp*256

    So turn off aircon -
    aircon set_zone_hvac_mode 254/172 2 0,1,2,3,4 0 0 0 0 0 3 6272 0

    Turn on aircon for zones 1 & 2 (and turn off for zones 3 & 4) @ 24.5 degrees
    aircon set_zone_hvac_mode 254/172 2 0,1,2 3 0 0 0 0 3 6272 0
    aircon set_zone_hvac_mode 254/172 2 3,4 0 0 0 0 0 3 6272 0

    What I'm not getting back from c-gate is the aircon status messages (which I can see from events.txt in the logs directory. Without them I can't see the current temp and if someone has turned the aircon on or off or changed the zones or temperature. I'm not seeing them on port 20025
     
    Last edited: Jan 17, 2018
    Brenda Selwood, Jan 17, 2018
  9. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Cgate supports the aircon app so it will work just fine using cgate commands as you have shown.

    Not sure why you don't get temperature event. They should look like:

    #s# # aircon zone_temperature //ALBATRSS/254/172 1 3 8066 0 #sourceunit=41 OID=71ef49d0-da24-1035-bddc-aecf1d0be953

    The 3 is the zone number and 8066 the temperature in 1/256 of a degree (i.e. 8066/256 = 31.5degC)

    Do you have a logic device available? If so, it's all quite simple.
     
    Ashley, Jan 17, 2018
  10. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @Ashley
    Thanks for the info Ashley.
    @Brenda Selwood
    On port 20023 you can open an event viewer which will show event and status.
    events e7s1c0
     
    DarylMc, Jan 17, 2018
  11. ievolve

    Steve Tester

    Joined:
    Aug 3, 2004
    Messages:
    31
    Likes Received:
    0
    Location:
    Melbourne
    Hi All,

    Looks like a very interesting solution.
    I have installed HomeBridge & when I run it I get the following error

    [2018-2-3 15:46:54] [CBus] Initializing homebridge-cbus.CBus platform...
    cbus:client Opening connection to C-Gateā€¦ +0ms
    [2018-2-3 15:46:54] Loading 0 accessories...
    cbus:client C-Gate connection open. +6ms
    cbus:client C-Gate session not ready -- unexpected message: 201 Service ready: Mosquitto C-Gate Version: v2.10.5 (build 3140) #cmd-syntax=1.0 +5ms
    anyone able to help with what might be the issue?

    Steve...

     
    Steve Tester, Feb 3, 2018
  12. ievolve

    ICS-GS

    Joined:
    Nov 1, 2004
    Messages:
    347
    Likes Received:
    0
    Location:
    SE Melbourne
    I am finding the same problem (I think), however I started this yesterday, with a starting point of Toolkit 1.15.2
    my 'real' project does not seem to work. However "HOME" and "Example" seem to be OK.

    Please don't tell me I have to downgrade and re-create my 'real' project from scratch.
     
    ICS-GS, Feb 8, 2018
  13. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @ICS-GS
    I had some funny business at a job recently using Toolkit 1.15.2 but I have not determined if it was something I did wrong while moving xml's about.
    Since then I've not found any problems in my testing at home with 1.15.2
    At home I shutdown Homebridge service and transferred all the unit programming to CGate database on the pi in case that caused some problem.

    Just to mention.
    If you are using CGate zip distribution on Linux you need to make sure you have the latest version to match Toolkit 1.15.2.
    You will also need Java v8 instead of v7
     
    DarylMc, Feb 9, 2018
  14. ievolve

    ICS-GS

    Joined:
    Nov 1, 2004
    Messages:
    347
    Likes Received:
    0
    Location:
    SE Melbourne
    Is an "accessory" a group address, in cbus speak?
     
    ICS-GS, Feb 9, 2018
  15. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    That is how I read it.
    I haven't tried over 100 group addresses.

    There is a work around on the github site by running multiple instances of Homebridge.
     
    DarylMc, Feb 9, 2018
  16. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
  17. ievolve

    ICS-GS

    Joined:
    Nov 1, 2004
    Messages:
    347
    Likes Received:
    0
    Location:
    SE Melbourne
    Thanks Daryl,

    I have been following your you tube tutorial and excel spreadsheet with the only exception being I tried to use the stretch version instead of jesse.

    as mentioned, I could not get my 'real home' project going properly on c-gate (possibly as it has 3 networks, and many, many group addresses). So I decided to see if I could just the the default "HOME" project to work. which seemed to be OK.


    I seem to be having trouble everytime I start the home bridge timer and get the following message

    Job for homebridge.timer failed.
    See "systemctl status homebridge.timer" and "journalctl -xe" for details.


    Interestingly though I don't get the same message for enable homebridge.timer

    could this be an issue with the config.json, as all I did was change the parameter

    "client_cbusname": "OFFICE", to "HOME"

    is there anything else I may be missing?
     
    ICS-GS, Feb 9, 2018
  18. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I did not have any luck with Stretch.
    Had service start troubles.
    Also tried Node v8 but have gone back to Node v7
     
    DarylMc, Feb 9, 2018
  19. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I believe the 100 accessory limitation is in the Home app.
    So as long as you only enable less than 100 accessories in Homebridge config I think it would be fine.
    I haven't had a chance to try multiple CBus networks.

    I have a fresh image uploaded if you want to have a look and try.
    Sending PM
     
    DarylMc, Feb 9, 2018
  20. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    If you see OFFICE anywhere in the documents I uploaded you need to change it to your project name.
     
    DarylMc, Feb 9, 2018
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.