This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[Advanced] Link HA Bridge to Homey

2»

Comments

  • @swtt I have similar challenges as ericjanvanputten in april. Apparently you've been able to get it fixed with a few changes. This is what I have.

    Can you have a look what might be missing or should be changed?

    thank you
  • @Oskar
    what kind of device are you trying to switch? 
  • swttt said:
    @Oskar
    what kind of device are you trying to switch? 
    it's a kaku powerplug. Here's a small part on what I see in the device config from Homey

    "id": "8e4be87a-cbe2-4285-9572-d27d53ed2387",
    "name": "Buffetkast",
    "driver": {
    "uri": "homey:app:nl.klikaanklikuit",
    "id": "APA3-1500RS",
  • Huhm... its missing the part where i can see the capabilities tho. But if its just a switch (onoff) then it should have that capability.  (just checked, the driver has the onoff capability)

    Can't find anything in your screenshot that looks wrong tho...

    You are sure the bearer token is correct right? Other devices are working?
  • swttt said:
    Huhm... its missing the part where i can see the capabilities tho. But if its just a switch (onoff) then it should have that capability.  (just checked, the driver has the onoff capability)

    Can't find anything in your screenshot that looks wrong tho...

    You are sure the bearer token is correct right? Other devices are working?
    @swttt I am using the bearer token that I also use in other apps, and those seem to be working.
    can you explain how I could find out how to trace/log what's happening, or just test it further. Aside of filling in as per your instructions, I have no idea what's happening, or how I could test this in a different way (I am not a developer).
  • allmost sure its not the issue, but worth a shot.

    Could you try to end the url with a '/' as well?
  • swttt said:
    allmost sure its not the issue, but worth a shot.

    Could you try to end the url with a '/' as well?
    Tried, but no luck.
  • Oskar said:
    swttt said:
    allmost sure its not the issue, but worth a shot.

    Could you try to end the url with a '/' as well?
    Tried, but no luck.
    I also tried copying the HTTP url in my browser: this seems to be working (with and without the "/".
    When the switch is is off I get a response: {"status":200,"result":{"onoff":false}},
    and when I manually turn it on I get a response: {"status":200,"result":{"onoff":true}}.
    And I am sure the bearer token is also correct.

  • huhmpff...and no spaces in the headers part that shouldn't be there and vice versa?
    What happens when you press test from the ha-bridge UI? Any error?
  • nothing at all - not even a log entry
  • It should give an error tho when something is wrong :/
    You did spam the TEST ON and TEST OFF buttons? It just flooded my screen with errors while something is wrong..
  • hmmm - than it is how I set up HA bridge perhaps. I have not made any changes in the set up in "bridge control". Should I look there?
  • Nah, didn't changed anything in there as well. But after adding a device it shows up in the bridge devices tab with some test buttons behind it.


  • OskarOskar Member
    edited November 2017
    indeed

    but pressing the buttons like off & on does not trigger anything.

    However I just got this error, not sure what to do with it:

  • Weird...if the response isn't valid it should throw a lot of errors. (just tested the errors part.. )
    And you are sure HA-Bridge has access to the same network as your homey? You could try the cloud id url to check if that works: https://YOURCLOUDID.homey.athom.com/api/manager/devices/device/${device.targetDevice}/state

    I see you got the target set in the settings, so that url should work with the bearer token and the cloud id.
  • Yes all on the same network.
    I don't know anymore: Taking copy-past from: http://192.168.1.24/?bearer_token=f14e418.... (the whole string), into the URL as you suggested and getting a message that this homey is not connected.

  • The cloud id is in your settings, that is the bearer token. 

    But if that isn't the case i am out of options as well <span>:open_mouth:</span>
    all i can say is check your input 1 char at a time...make 1000% sure their aint errors in there..
  • DEBUG info (he he):

    11-27-2017 21:29:13.890DEBUGhue state change requested: e5cd7ab3e2ba4d5392d7012a861f57b9 from 192.168.1.35 body: {"on":true}com.bwssystems.HABridge.hue.HueMulator
    11-27-2017 21:29:13.891DEBUGvalidateWhitelistUser: found a user <e5cd7ab3e2ba4d5392d7012a861f57b9>com.bwssystems.HABridge.BridgeSecurity
    11-27-2017 21:29:13.892DEBUGDecode Json for url items: [{"item":"http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state/","type":"httpDevice","httpVerb":"PUT","httpBody":"{\"onoff\":true}","httpHeaders":"{\"name\": \"Authorization\",\"value\": \"bearer f14e41853048d035xxxxxxxxxxxxxxxxx\"}","contentType":"application/json"}]com.bwssystems.HABridge.hue.HueMulator
    11-27-2017 21:29:13.894DEBUGexecuting HUE api request to Http PUT: http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state/com.bwssystems.HABridge.plugins.http.HTTPHome
    11-27-2017 21:29:13.895DEBUGRequest <<http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state/>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-27-2017 21:29:13.896DEBUGRequest <<{"onoff":true}>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-27-2017 21:29:13.914ERRORspark.webserver.MatcherFilter

  • @swttt

    Thank you for the tutorial. Works great for me.

    Christoph
  • @Oskar
    Not much in that error btw...you did tried multiple devices right?
  • another try. I've reinstalled HAbridge in the mean time (seems a different version now), and readded my device again. I now do get a better log:

    11-29-2017 20:05:09.157DEBUGDecode Json for url items: [{"item":"http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state","type":"httpDevice","httpVerb":"PUT","httpBody":"{\"onoff\": false}","httpHeaders":"{\"name\":\"Authorization\",\"value\":\"bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}"}]com.bwssystems.HABridge.hue.HueMulator
    11-29-2017 20:05:09.185DEBUGCalling Home device handler for type : httpDevicecom.bwssystems.HABridge.hue.HueMulator
    11-29-2017 20:05:09.191DEBUGexecuting HUE api request to Http PUT: http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/statecom.bwssystems.HABridge.plugins.http.HTTPHome
    11-29-2017 20:05:09.194DEBUGRequest <<http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-29-2017 20:05:09.195DEBUGRequest <<{"onoff": false}>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-29-2017 20:05:09.207ERRORspark.http.matching.GeneralError
  • @swttt
     Nice one.. havent tried this yet, but looking forward to it.. im a REAL github beginner, but i hope i can make it work.. when the "app" is installed, will alexa do the rest of the work, or is there a lot of manuel tweaking before it gets up and running?
  • DeoDeo Member
    edited December 2017
    its works good :) thnx

    <Modbreak> Plz keep it in English. There is a lot of peeps from outside of Holland to read along.


  • Oskar said:
    another try. I've reinstalled HAbridge in the mean time (seems a different version now), and readded my device again. I now do get a better log:

    11-29-2017 20:05:09.157DEBUGDecode Json for url items: [{"item":"http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state","type":"httpDevice","httpVerb":"PUT","httpBody":"{\"onoff\": false}","httpHeaders":"{\"name\":\"Authorization\",\"value\":\"bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}"}]com.bwssystems.HABridge.hue.HueMulator
    11-29-2017 20:05:09.185DEBUGCalling Home device handler for type : httpDevicecom.bwssystems.HABridge.hue.HueMulator
    11-29-2017 20:05:09.191DEBUGexecuting HUE api request to Http PUT: http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/statecom.bwssystems.HABridge.plugins.http.HTTPHome
    11-29-2017 20:05:09.194DEBUGRequest <<http://192.168.1.24/api/manager/devices/device/8e4be87a-cbe2-4285-9572-d27d53ed2387/state>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-29-2017 20:05:09.195DEBUGRequest <<{"onoff": false}>>, not done: falsecom.bwssystems.HABridge.hue.DeviceDataDecode
    11-29-2017 20:05:09.207ERRORspark.http.matching.GeneralError
    After quite a bit of trial and error and we found a solution by including the square brackets around the http header. 

    @swtt thanks for the help and thinking about the options. I now have my virtual hue bridge fully working and have successfully connected it also with my Harmony remote to switch my lights with the TV remote.
  • DutchieDutchie Member
    edited December 2017
    Nice work! So if I understand it correctly I can control my z-wave fibaro dimmers like they are hue lights. Since a couple of days I have an Amazon Echo to control my hue and ikea lights and IFTTT to control my lights connected to Homey. But this adds another word (trigger) to my voice command. When I configure every device correctly in HA-Bridge then I can control the lights connected to homey with the same voice commands as with my hue lights.

    Is that correct? Then I will definetly install RPi tommorow :smiley:
  • Dutchie said:
    Nice work! So if I understand it correctly I can control my z-wave fibaro dimmers like they are hue lights. Since a couple of days I have an Amazon Echo to control my hue and ikea lights and IFTTT to control my lights connected to Homey. But this adds another word (trigger) to my voice command. When I configure every device correctly in HA-Bridge then I can control the lights connected to homey with the same voice commands as with my hue lights.

    Is that correct? Then I will definetly install RPi tommorow :smiley:
    It looks like it should work for you as well.
    I have configured 3 lights: 1 kaku light switch, one is a kaku power plug and one a Fibaro controlled dimmer switch. All 3 work (for now just tested with "onoff" function). They work on the Harmony remote (hue detected the bridge automatically) and also on the official Hue app (although it requires manual IP address to be entered). All good and reliable. I do not have an Echo, so I just assume it is working for your set up.

    I also tried connecting ha-bridge to the Hue function from "the voice" TV show, but that has not worked. Probably not able to get this done as it is not 100% compatible with the real Hue bridge.
  • Has anyone managed to identify the command for non Boolean devices? 
    I've just set up Heimdall and want to activate the Armed function using Habridge
    Thanks
  • JBSJBS Member
    edited April 2018
    Was running ha-bridge on my RPI just perfect for months. Want to run it in Docker now and used this one https://hub.docker.com/r/habridge/ha-bridge-raspberrypi3/ mentioned on https://github.com/bwssytems/ha-bridge but Alexa can not find added devices. When using the 'Test' button on the Bridge Control tab, I am able to see some output with the added device.

    Anything special needed when running this in a Docker?

    \Edit: Not sure why, but the devices are found now.
Sign In or Register to comment.