Apple homekit integration!

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

  1. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    Hi Simonhac,

    Have a browse on YouTube in reference to R.Pi cooling / water cooling / heat sink.

    The issue happens around 80C which is the temp of the R.Pi when its busy. Then the CPU throttles back and stays around 70C.

    I was looking at keeping the CPU at or around 55C to 60C.

    https://www.youtube.com/results?search_query=raspberry+pi+cooling+




    I personally prefer thermal protection. It will extend the life of the SD card and the board itself. Everything is made to a price and it does matter that heat soaks through the entire system as this may impact on communication packets and data loss.

    When systems throttle down, there will always be some interruption and CBUS is sensitive to some kinds of delay more than other types of delay. Especially when there are scenes backed by logic.
     
    Last edited by a moderator: May 8, 2017
    tobex, May 8, 2017
  2. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Tobex
    Are you planning to mine some bitcoins on yours :)

    Homebridge-CBus and CGate running on pi3.
    CPU use is around 1%
     

    Attached Files:

    DarylMc, May 8, 2017
  3. ievolve

    djaggar

    Joined:
    Jul 18, 2009
    Messages:
    66
    Likes Received:
    0
    Location:
    New Zealand
    I have a little experience here ... I have a Pi3 with a 5000SM/2 running CGate, and OpenHAB2, running my house. Because it's not HomeKit it's way off topic, but the hardware would obviously be fully applicable so I posted it here anyway ... apologies in advance.

    [​IMG]

    It's just in a 3d printed case. I don't have a screen on in because I usually just SSH or VNC to it (very occasionally, it's been rock solid for about 3 years). Of course you can always connect the HDMI to a big screen as well. There is no heatsink on the processor, but I doubt it is ever working hard enough to need it ...

    The other thing I built which may be of interest is a Pi Server (in a variety of configurations), it does have 3.5 TFT touchscreen (and a couple of tripod holes!)

    [​IMG]

    Inside there is a small LIPO battery, insulated from the warm bits, a voltage booster, and a very small fan (15mm), with enough 3D printing to direct the air flow over the CPU heatsink and insulate things electrically. When it is together there is very little free space anywhere ... the screen rests upon the USB ports, and the battery sits under the screen between the processor and the USB. The voltage booster gets quite hot, so I put it in the fan airflow. I tried using a big copper heat slug as a heatsink, but it just got hotter and hotter. I hate fans too ... but this one is so low power it is just hard wired to 5V, but you could easily wire it to a Pi GPIO and have it temperature controlled ...

    [​IMG]

    (Even more off topic but I travel with one like this, with a bigger external battery and a 2TB Samsung portable SSD. The USB thing is the smallest 802.11ac WiFi I could find to create a hotspot, and it creates a VPN over the internal WiFi, Ethernet or 4G back to my home, it's kind of like a local cloud cache for my main home server ... I only mention is here because it might be relevant as a WiFi Access Point running Homekit etc etc)

    [​IMG]
     

    Attached Files:

    djaggar, May 8, 2017
  4. ievolve

    cmlp

    Joined:
    Feb 5, 2008
    Messages:
    32
    Likes Received:
    2
    Location:
    Melbourne, Australia.
    No IR gun handy, but...

    $ cat /sys/devices/virtual/thermal/thermal_zone0/temp
    49768

    = 49.768C

    Pi 2 Model B running cgate w/ openjdk (I think, it's been a while since I installed it!).
     
    cmlp, May 8, 2017
  5. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    lid on case pi@raspberrypi:~ $ cat /sys/devices/virtual/thermal/thermal_zone0/temp
    46160

    lid off case pi@raspberrypi:~ $ cat /sys/devices/virtual/thermal/thermal_zone0/temp
    42932
     
    Last edited by a moderator: May 8, 2017
    DarylMc, May 8, 2017
  6. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    I dont suppose you would torrent / google drive / dropbox the drive image ?

    BTW: I like projects with increased life span and lower than average temps.
     
    Last edited by a moderator: May 8, 2017
    tobex, May 8, 2017
  7. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi tobex
    My image is 32 GB and I'm not sure I will be able to shrink it easily.
    Not because it needs to be but because that is the size of the micro SD.

    What bits have you got already?
     
    DarylMc, May 9, 2017
  8. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    surely there's a way of creating a 'sparse image' where all the unallocated 'sectors' are compressed to nothing?
     
    simonhac, May 9, 2017
  9. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi Simon
    Yes I am sure.
    But I am a Linux beginner.
     
    DarylMc, May 9, 2017
  10. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi Tobex

    You better get your Homebridge CBus working right now.
    I've seen platforms come and go.
    10 years ago I used Windows phones and that is pretty much finished now.
    In 10 years time will Apple still support homekit?
    Who is to say?
    In 10 years time there might not even be iPhones or CBus.

    There has been valid warnings on this thread that Apple could lock out homebridge at any time.
    In only 5 years raspberry pi has gone through a few hardware changes and many software updates.
    I wouldn't get too hung up spending too much time worrying about the longevity of a $50 piece of hardware.
    The time spent configuring it far surpasses that no matter how little you think your spare hours are worth.

    Homebridge can provide iOS voice control right now, Clipsal does not and probably never will.
    It's not all bad though.
    The robustness and thought that went into CBus over a decade ago still amazes me.
    it's astounding what the latest technology can do with CBus.
    No way am I relying on the automation button in Homekit to do anything for a CBus network even with 15 years worth of technology improvements.
    Grab the voice control and use it while you can.
     
    DarylMc, May 9, 2017
  11. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    Hi DarylMC,

    Home Automation was advocated to Apple several times between 2010-2013 and it has taken this long to see an open platform. My impressions are as follows;

    1/ CBUS will be around for another 20 years. It has a proven reliability and stability when installed correctly. The only changes I can foresee are the dramatic shrinkage of components to a type of "inline" module sitting directly on next to a light.

    Wiring design will undergo a revolution and many companies will move to a technology which allows them to use one power cable for every light in a zone. Yet retain the function of total control over each light source or relay.

    This would cut down wiring costs about 80%.

    2/ Wiring technology will move closer towards IDC connectors where you strip the outer insulation and crimp the inner wires into a connector. The proliferation of surface sockets and inline GPO has been the standard since 1995. We are essentially moving away from one cable to one light, back to the wiring closet. That will come to an end in order to conserve resources.

    Refer to discussion point 1

    3/ An old CBUS gateway or an old Homebridge is still compatible with newer or older CBUS. That wont change any time soon. If apple decides to get aggressive on automation, expect to see a gateway and an SDK in the shape of Apple TV box.

    Apple doesnt undermine its own market. They make it less agile for outsiders to make money from their software. Therefore they will release their own gateway and software environment. This hub will also include the ability to route phone calls into a home phone system by leaving your phone near the hub.

    Apple is not the type of corporation which denies opportunity to developers. Their ecosystem on the other hand is not open to non-subscribers and they expect a fee for making provisions for other companies.

    4/ The translation of data between CBUS and Apple will always be possible because an Apple SDK and Clipsal Open Protocol allows seamless communication between these two platforms. I dont see how Apple can shut down a form of communication which is more or less a serial protocol.

    485 to serial to ethernet is more or less the same thing as the Airport Version 1 network router which looked like a Roswell UFO. That device is still being supported today and I dont see how that router is different from a CBUS CNI.

    I believe where this is heading is towards clipsal paying apple for a developer permit and allowing Wiser 2 to become Apple aware. If the R.Pi community grows large enough we will all be forced to ditch the home-brew and go OEM.

    5/ The cooling solution is a long term project with applications outside of lighting. It needs to be done.

    Those are my thoughts on this topic. I wouldnt be against apple because the android community demonstrated a remarkable resilience many times over to fill in the gaps where Apple didnt want to go. Have a close look at TVPad as a perfect example of a dubious but successful AppleTV clone with an open architecture.

    Also have a look at some of the routers on the market with a free SDK allowing the router to be turned into anything. Then also look at QNAP and Synology.

    The inclusion of several key elements into NAS servers happened more than 10 years ago via very lengthy submissions. You are only now seeing the diversity of what those NAS servers are capable of.

    This isnt Nokia all over again. The options are limited only by the apps.

    BTW ... CBUS is about 20+ years old. I have a piece at my place called "Opera House" meaning it came from the Sydney Landmark.
     
    Last edited by a moderator: May 11, 2017
    tobex, May 11, 2017
  12. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    I have a R.Pi 3B and a 16GB card with boots from Element 14. It claims to be a heat tolerant SD flash (which most of them are not). I can find a larger card if I can find a robust version with temp tolerance.

    I also have a serial and Ethernet CNI, DIN box, meanwell DIN power supplies in various voltages and a DALI gateway.
     
    Last edited by a moderator: May 11, 2017
    tobex, May 11, 2017
  13. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi tobex
    The pi 5v power supply is quite critical.
    Have a read up if you are not sure.

    16 GB card will be plenty.

    If you can download my spreadsheet I think you will find it pretty easy to follow in conjunction with the links.
    I tried to think of all the things which might be difficult for someone new to linux like myself.

    If someone had trouble following those instructions then I don't think a supplied image would be much help.
    Send a PM if you find any problems.
     
    Last edited by a moderator: May 11, 2017
    DarylMc, May 11, 2017
  14. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    The Meanwell power supply is 3A and has a voltage output adjustment screw for voltage. I dont know if the power supply has issues with current supply under different CPU loads. I will test it out.

    The NOOBS OS I have resident on my SD card is intended for people like me who find R.Pi a bit odd.

    How do I put a GUI on my Pi ?
     
    Last edited by a moderator: May 11, 2017
    tobex, May 11, 2017
  15. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    pm sent
     
    DarylMc, May 11, 2017
  16. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    daryl, two things are different:
    * hombridge is open source, well written, a large number of developers working in the ecosystem and many users
    * there's nothing tying homebridge permanently to apple's homekit -- a single, small module would extend it to whatever other system you can think of, in fact, there's already an amazon echo/alexa bridge.
     
    simonhac, May 12, 2017
  17. ievolve

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    Yes, Alexa is always there on the reserve bench.
     
    tobex, May 12, 2017
  18. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I'm hoping forum member djaggar is going to jump in and tell us how to install both on PI3 :)
     
    DarylMc, May 12, 2017
  19. ievolve

    star lord

    Joined:
    May 14, 2017
    Messages:
    1
    Likes Received:
    0
    Location:
    Sydney
    Working with Mac Mini

    Awesome work - breaths new life into my CBUS setup!

    I was able to follow the instructions and get homebridge and cgate working as daemons on my mac mini with siri voice controls to Apple's homekit all working in a few hours. Pharking fantastic!

    https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-macOS

    https://www.npmjs.com/package/homebridge-cbus

    A few traps to avoid:
    - use JDK7 (JDK8 doesn't work with cgate)
    - use the "platform_export" option in config.json to get your current accessories (don't guess what they might be like I did the first time!)
    - set the project.default and project.start settings in the cgate config file to your xml project name in your cgate/tag dir. This isn't needed with the windows version of cgate/toolkit, but homebridge-cbus doesn't open the project and network automatically when just running the cgate jar yourself.
    - Update the Cgate Access control config so you can can connect the windows toolkit to the remote gate running on the mac mini.

    All these tips are in various posts, but thought I'd contribute for mac mini users by putting them all in one place.

    launchctl file for cgate daemon posted below for those interested. Any suggestions welcome.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
     <key>RunAtLoad</key>
     <true/>
     <key>KeepAlive</key>
     <true/>
     <key>Label</key>
     <string>com.cgate.server</string>
     <key>ProgramArguments</key>
     <array>
    	<string>/usr/bin/java</string>
    	<string>-jar</string>
    	<string>/Users/yourname/Applications/cgate/cgate.jar</string>
     </array>
     <key>StandardOutPath</key>
     <string>/Users/yourname/Applications/cgate/logfile.log</string>
     <key>StandardErrorPath</key>
     <string>/Users/yourname/Applications/cgate/errorfile.log</string>
     <key>EnvironmentVariables</key>
     <dict>
    	<key>PATH</key>
    	<string>/usr/local/bin/:$PATH</string>
     </dict>
     <key>WorkingDirectory</key>
     <string>/Users/yourname/Applications/cgate</string>
     </dict>
    </plist>
     
    star lord, May 14, 2017
  20. ievolve

    simonhac

    Joined:
    Jan 8, 2017
    Messages:
    51
    Likes Received:
    0
    Location:
    Melbourne
    thanks @starlord for putting it all in one place. very helpful.

    hmm, i use JDK8 (1.8.0_25) on my mac whenever i use cgate locally. how does JDK 8 fail for you?


    a future version of homebridge-cbus will include a `setup mode` which will offer to automatically create the config.json file. see this issue.


    a future version of homebridge-cbus will obviate the need for this step. see this issue.

    please feel free to post suggestions and report bugs to the issues list.

    -s
     
    simonhac, May 15, 2017
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.