Google Home, Smartthings, OpenHAB, etc, etc.

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

  1. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    120
    Likes Received:
    1
    Location:
    Sydney, Australia
    OK, so finally got HA running in a docker. talks to my AC (daikin), Cameras (hikvision), doorbell (ring), irrigation (b-hyve), blinds (neosmartblinds) and now c-bus.

    right now, i have CNI --> cgate-server (docker) --> cgate-mqtt (docker) --> mosquitto (docker) --> HA

    and it works. and its pretty fast. dimmer cards etc.

    so today, i cloned the github of cmqttd to give it a go. took me ages, never done it before. but, now makes complete sense.

    it starts up, and connects to the CNI and MQTT broker but then i get a crap load of python errors, it restarts and does it all over again.

    anyone else had that?
     
    zei20t, Oct 20, 2020
    #21
    1. Advertisements

  2. gtervit

    gtervit

    Joined:
    Dec 5, 2017
    Messages:
    4
    Likes Received:
    2
    Sounds like everyone's having fun getting this working, and loads of different ways too.

    A minor update from me... having been happy with the OpenHab arrangement and also having purchased a QNAP NAS, I went fully docker. Just took two images and it all works:

    1) Created a docker container based on steppinghat/cgate-server:latest (it's just cgate, no MQTT).
    Docker config: Private vnet, with port forwarding to let other machines on my local network get to it on the standard cgate ports (20023-26,20123). Externalised all the config/logs folder so they sit outside the container and are therefore easy to get at.
    Cgate config: Added the standard cgate config file to tell it where the CNI is and who to permit access (local subnet), and to auto-open my network.

    2) Created a docker image based on openhab/openhab:latest.
    Docker config: network-mode:host so it can do broadcast/multicast discovery on the local network - not needed for cgate, but helps with other bindings.
    OpenHab Config: Added in the cgate binding (included), pointed it to the cgate container (ip address of the NAS due to the port forward)
    Config openhab link to the web for google home access using openhab cloud connector.

    All working. no problem. No MQTT, lights just show up in openhab as the cbus binding supports discovery, voice control working, etc. And all neatly wrapped up in containers for easy creation via yaml files, easy image based updates, restarts automatically, external config/log files on a nice share I can get to from windows, etc.

    only gotcha was having to add google automation tags to each individual light I wanted to tell OpenHab to expose to google on the openhab console via ssh: eg, smarthome:metadata add HallwayDimmer ga Light

    Oh, and I swapped out the wiser after it bricked for the second time and had to get it RMA-ed, and since I wasn't using it for anything other than a CNI. Now just using a 5500CN2. Anyone want to buy a brand new Wiser2? :)
     
    gtervit, Oct 20, 2020
    #22
    1. Advertisements

  3. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    120
    Likes Received:
    1
    Location:
    Sydney, Australia
    wow openhab talks to a cgate server? holy crap thats good!

    i might look into that too, but ive put a heap of effort into HA lol
     
    zei20t, Oct 20, 2020
    #23
  4. gtervit

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    407
    Likes Received:
    47
    Location:
    Perth
    Be super careful with open HAB it breaks Ubiquiti Unifi and a number of other things. Its a poorly coded POS with a pretty interface. They brute force the webserver to intercept all web requests rather than a port by port approach,
     
    chromus, Oct 20, 2020
    #24
  5. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    120
    Likes Received:
    1
    Location:
    Sydney, Australia
    ahh damn. how does it break unifi? i used it last year to play with, but it didnt break network stuff.
     
    zei20t, Oct 20, 2020
    #25
  6. gtervit

    arrikhan

    Joined:
    Oct 16, 2011
    Messages:
    47
    Likes Received:
    5
    Location:
    Australia
    Did you ever fix this ? I’ve built a container and had exact same problem with python errors.

    Code:
    Local time zone: Australia/Melbourne
    
    Current time: Sun, 13 Dec 2020 14:36:48 +1100
    
    Running with flags: --broker-address 10.1.0.220 --timesync 300 --broker-port 1883 --tcp 10.1.0.240 --broker-disable-tls
    
    Traceback (most recent call last):
    
      File "/usr/bin/cmqttd", line 11, in <module>
    
        load_entry_point('cbus==0.2', 'console_scripts', 'cmqttd')()
    
      File "/usr/lib/python3.8/site-packages/cbus/daemon/cmqttd.py", line 474, in main
    
        run(_main())
    
      File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    
        return loop.run_until_complete(main)
    
      File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    
        return future.result()
    
      File "/usr/lib/python3.8/site-packages/cbus/daemon/cmqttd.py", line 448, in _main
    
        factory, addr[0], int(addr[1]))
    
    IndexError: list index out of range
    
    Using TCP CNI at 10.1.0.240
    
    Disabling TLS support. This is insecure!
    
    /etc/cmqttd/auth not found; skipping MQTT authentication.
    
    /etc/cmqttd/project.cbz not found; using generated labels.
     
    arrikhan, Dec 13, 2020
    #26
  7. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    120
    Likes Received:
    1
    Location:
    Sydney, Australia
    Hey mate,

    no, never did. but i got pretty similar errors to you.

    the current setup seems to be working fine and does what i want. for now.

    i have to configure each group to work in HA. but realistically, i dont have every light available in HA, just the ones i want to automate from another system to cbus.
     
    zei20t, Dec 14, 2020
    #27
  8. gtervit

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    120
    Likes Received:
    1
    Location:
    Sydney, Australia
    so i think it only supports authenticated MQTT.

    that said, i havent tried it again since this time.
     
    zei20t, Jan 21, 2021
    #28
    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.