Google Home, Smartthings, OpenHAB, etc, etc.

Discussion in 'Voice Control' started by gtervit, Apr 7, 2020.

  1. gtervit

    gtervit

    Joined:
    Dec 5, 2017
    Messages:
    4
    Likes Received:
    2
    Just wanted to share my experience so far with the "how can I tell google to dim the cbus lights?" journey!

    My first attempt was HomeAutio:
    Google Home --> [ NGINX --> HomeAutio.MQTT.GoogleHome --> MQTT --> C-GateWeb --> Cgate ] --> Wiser (CNI) --> CBUS
    Items in [] running on a raspberry Pi. Custom RaspBian image, so a lot of add-ons and tweaks.

    That worked ok, but it needed a port-forward which I wasn't keen on, plus you need to set up certs, etc, etc, it was all a little bit clunky and had too many moving parts. C-GateWeb didn't support (MQTT) discovery, so that was a nuisance to set up, lots of custom config file editing, etc.
    I also couldn't create "groups" or "automations" of any sort, so turning off 4 lights meant sending 4 commands from google home (wrapped up in a routine), which was slow and clunky and sometimes failed.

    I then tried HomeAssistant:
    Google Home --> NabuCasa.com <-- [ HomeAssistant --> MQTT --> C-GateWeb --> Cgate ] --> (Wiser) CNI --> CBUS
    [] on the RaspPi.

    That worked better. It needed a license for NabuCasa, but it's not expensive and I could get the main things I needed, plus some automation out of HA. Main thing was getting rid of the port-forward and certificate management nonsense, plus the ability to send one command from google to control multiple lights. No more "Hey Google, Movie Mode" slowly turning down one light at a time.

    A new option?
    I see clipsal have released a docker image (cmqttd) which acts as an MQTT bridge complete with MQTT discovery, so I'd probably have been tempted to try that in place of C-GateWeb if I hadn't already switched to OpenHAB).

    I've now moved to OpenHAB:
    Google Home --> OpenHAB Web <-- [ OpenHAB2--> CBus Binding --> Cgate ] --> (Wiser) CNI --> CBUS
    Again [] is the raspberry pi. This time I used OpenHabian which made everything easy and I only needed to add cgate.

    So much better - adding the cbus binding and giving it the IP address of my CNI (localhost!) automatically discovered all my lights and they popped up automatically as "things" in OpenHab. Create items from things, add google assistant metadata (manual from the console, so a little nuisance) and voila - all the lights appear in google home. Very slick. Also successfully set up a few automations using the rules engine addon in OpenHAB, so happy days.

    I think I preferred the HA UI to OpenHAB's UI, but it gets the job done and I really mostly just wanted the bridge.

    Happy to DM the notes I made during install for any of the above if anyone's struggling to get it working.

    Add in Smartthings:
    I then added the smartthings binding for OpenHAB (I have a hub & a bunch of sensors over zigbee there) and I can now automate things like "turn on the outdoor lights if I open the patio door at night, and turn them off again when I close it".

    That got me thinking though - wouldn't it be (theoretically) possible to write a device driver (and perhaps a smartapp) in smartthings to talk directly to the CNI? Since smartthings already has Google Home integration, plus the ability to execute rules, I'd get rid of a secondary unnecessary hub (OpenHAB).

    Something like:
    Google Home --> SmartThings Web <-- { SmartThings Hub --> Custom Device Driver } --> CNI --> CBUS
    With {} on the hub

    If only there was a SmartThings dev willing to take it on!
     
    Last edited: Apr 7, 2020
    gtervit, Apr 7, 2020
    #1
    Robert and jboer like this.
  2. gtervit

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Great write up! Thanks for that.

    The Smartthings side is possible, I looked into it in depth a little while ago. However with the new alliteration of SmartThings you probably would be looking at a cloud based server that then talked into your CNI. Very similar to what SmartVoice does now for other services.
     
    jboer, Apr 11, 2020
    #2
    gtervit likes this.
  3. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    SmartThings is pretty broken atm, they have stopped replying to iOS support requests.

    Samsung backed through wrong pony and now none of their devices work with iOS devices.
     
    chromus, Apr 12, 2020
    #3
  4. gtervit

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Yeah I just head from a friend that he also was giving up on it due to dodgy (Samsung/Official SmartThings not 3rd party stuff) sensors and devices and no support from SmartThings with it... its a real shame as it was really something that was heading in the right direction.
     
    jboer, Apr 13, 2020
    #4
  5. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    You're clearly more capable than me, despite adhoc attempts in the past, I only just got my Cbus set up talking to Homekit yesterday through some helpful posts in another thread and detailed instructions.

    I do also have Home Assistant set up on the same rpi unit and would like to get CBus talking to it as well. Where did you see the clipsal docker image? I also have a Synology NAS with docker so could use that as well.

    Thanks,
    Rob
     
    Robert, May 24, 2020
    #5
  6. gtervit

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    is there any more info on cmqttd/where is this available from?
     
    Pie Boy, May 24, 2020
    #6
  7. gtervit

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    Pie Boy, May 25, 2020
    #7
    Damaxx, Robert and gtervit like this.
  8. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    So to the luddites having a crack, this will let HA interface with Cbus directly?

    You make it sound easy but it'll probably take me all weekend!
     
    Robert, May 29, 2020
    #8
  9. gtervit

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    Yeah it was pretty straight forward to spin up,
    A couple of things to watch for, as a Linux noob myself,
    Here’s roughly what I did on raspi
    apt-get update and apt-get upgrade
    Then Install docker, there’s good documentation on google for this.

    Set docker user rights to user pi or what ever user/s you use— this lets you call docker commands without sudo first especially handy if you are ssh ing into pi

    -git clone the repository, after this I had to copy the contents across to home/pi

    then use command
    docker build cmqttd .
    That builds the docker image,

    Then you need the run command to create new container, this is where you specify the e variables, cni/serial -connection to cbus, Timezone, mqtt broker connection/ ip and if you use auth on your broker or not etc

    https://cbus.readthedocs.io/en/latest/installing.html#c-bus-mqtt-bridge-only-docker-image

    once You have that done the docker documentation is your friend...

    I had to copy across the txt file to the container for the username and password to my mqtt broker then stop and start the container then it was all up and running

    I have it talking to a cni and i am very impressed, it only supports lighting 56 atm
    But that’s all I think I’ll need.

    the next thing I need to do is look into is restart policies for docker container, If power loss reboot etc

    I don’t use HA, I’m just using this purely as a C-bus to MQTT Bridge
    But have a good look at the documents,
    Is is designed to work with HA
     
    Pie Boy, May 30, 2020
    #9
  10. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    130
    Likes Received:
    1
    Location:
    Sydney, Australia
    this is all an interesting read, makes me want to dive back into this!
     
    zei20t, Jun 1, 2020
    #10
  11. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    Robert, Jun 6, 2020
    #11
  12. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    I looked at all of the options and went with Homebridge, it’s not 100% mature but it “just works” in most cases and the “web ui-x” plug-in was a game changer for clients.

    The major advantage is it supports 56 as the default application, but u can on an item by item basis specify any other application number.

    Thanks to @JasonY00 and another guy it now supports Temp sensors for display and hopefully as event triggers in the not too distant.
     
    chromus, Jun 6, 2020
    #12
  13. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    Last edited: Jun 7, 2020
    Robert, Jun 7, 2020
    #13
  14. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    thats the scripted installer for the lazy and new peeps. it works great for clean installs.
     
    chromus, Jun 7, 2020
    #14
  15. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    I'm struggling with terminology and components. So the Greig in Sydney instructions installed Homebridge Broker and the CBUS plugin?

    These instructions
    https://www.npmjs.com/package/homebridge-mqtt
    Add mqtt client to HA?

    Have I got that right? I just want to make I sure I don't overwrite my working cbus homebridge setup

    Thanks,
    Rob
     
    Robert, Jun 7, 2020
    #15
  16. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    If you already have homebridge, then you dont need the Greig version, his is just an easy way to install it using a script rather than doing command line instructions manually.
     
    chromus, Jun 8, 2020
    #16
  17. gtervit

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    @Robert
    i use mosquito as mqtt broker,it is just apiece of software that passes mqtt messages around,
    the docker image cmqttd bridges lighting 56 to mqtt messages i think HA would need to communicate to an allready configured Mqtt broker in order to have control over cbus etc
    cbus <<=>> mqtt broker(mosquito)<<=>> HA

    if you just want HA to Cbus you can use the cmqttd docker image with the below by the looks of things...
    https://www.home-assistant.io/integrations/light.mqtt/

    if you already have homebridge <<=>> cbus set up and you want to use the cmqttd docker image you would need start again as the current cbus-homebridge set up talks to cgate i believe.

    you would need something to connect homebridge to mqtt like you pasted above https://www.npmjs.com/package/homebridge-mqtt
    cbus <<=>> mqtt broker(mosquito)<<=>> Homebridge
    you would also need to configure the homebridge side for the mqtt topics coming from the cmqttd
    if that makes any sense
     
    Pie Boy, Jun 8, 2020
    #17
  18. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    Yeah, I need an Mqtt broker


    I want to use HA to integrate Cbus with non Cbus devices

    Noooo, don't like the sound of that...without step by step, I'm not going to get this working again

    Yeah this is the bit that I have NFI

    Hmmm some options to ponder thanks for you feedback.

    Rob
     
    Robert, Jun 8, 2020
    #18
  19. gtervit

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    48
    Likes Received:
    1
    I installed homebridge from following Greig's instructions. I'm trying to understand if it can be used as an Mqtt broker, if I need to install another one and if I do, will it overwrite my current settings...

    All very black box to a luddite...
     
    Robert, Jun 8, 2020
    #19
  20. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    chromus, Jun 9, 2020
    #20
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.