Ha-bridge: What does this do, docs unclear

Created on 21 Feb 2017  路  16Comments  路  Source: bwssytems/ha-bridge

Interesting project but Im a little lost on what it is trying to achieve, in the faq it says:

The ha-bridge has helpers to build devices for the gateway for the Logitech Harmony Hub, Vera, Vera Lite or Vera Edge, Nest & HAL and the ability to proxy all of your real Hue bridges behind this bridge.

That sentence is a little hard to parse, could someone try to reword that? Another point of confusion is that it says it emulates Phillips hues api, what is the reason for this, is this because many devices already integrate with that so its an easy place to hook in at, or is it something else?

Anyway ideally i would like to control thermostats other than the nest with my harmony. The harmony only talks to the nest but Im hoping i can emulate the nests api with this and redirect it to my thermostat. Is that a use case for this project or have i got the wrong idea.

Thanks

question

Most helpful comment

@LukeDefeo I think you are getting distracted by the api side of things, the core concept of ha-bridge is really very simple (but very powerful).

Typical Hue use

You purchase and install a Philips Hue Starter Kit (bridge and bulbs) in your home.

Now you can turn the lights on and off with your phone, as well as the Hue Dimmer Switch stuck to your wall. Great!

Hue and Echo use

You then buy an Echo which out of the box can detect and control the same bulbs you already control with the app.

This is built in to the Echo and you do not need to use the Hue Skill for basic control.

You can say "Alexa, turn off the living room lights" and "Alexa, dim the living room lights to 40%" and she will. Super!


Ok, so we know the Echo can control Hue bulbs, what's the big deal?

ha-bridge gives you the ability to create software based "fake Hue bulbs"

These fake bulbs are seen by the Echo and treated as if they were physical Hue bulbs, and like physical Hue bulbs you can send ON, OFF and DIM commands to them

ha-bridge allows you to set what you want it to do when the fake bulb receives each of the three commands (you can fire a script, make a http request, press a Harmony button etc, the possibilities are endless)

e.g.

  • Receive ON command: do this thing
  • Receive OFF command: do this other different thing
  • Receive DIM command: do this other thing and send the value (number or percentage) as well

It doesn't matter what the fake device does, as far as the Echo is concerned it has just turned a bulb on.

This means you can create a voice controlled switch for pretty much anything as long as you can do it with a computer :)

Can you see the attraction and power now? :)

All 16 comments

"Emulates Philips Hue api to other home automation gateways such as an Amazon Echo or Google Home. The Bridge handles basic commands such as "On", "Off" and "brightness" commands of the hue protocol. This bridge can control most devices that have a distinct API."

Since the Harmony Hub can talk to a Philips Hue, it can talk to this ha-bridge. The helpers are on the UI to build the proxy devices for those types of automation systems as the helpers list the available devices on those systems. You can build custom devices that talk HTTP, HTTPS, TCP or UDP to control any device that has a sessionless API to call.

Ok so if my device roughly fits into the api of Phillips hue I can use if as an adaptor layer. Interesting stuff. Does it have to be Phillips hue that Alexa thinks it's controlling. Also where can I learn about the api of hue under the hood

So, the path for this is:

                     +------------------------+    +------------------------+
+-------------+      | H A +------------------|    | A +------------------+ |
| Harmony Hub |----->| U P | ha-bridge core   |--->| P | Device to control| |
+-------------+      | E I +------------------|    | I +------------------+ |
                     +------------------------+    +------------------------+

Cool that's awesome, any tips on how to reverse engineer the api for my thermostat, it's by netatmo.

One other question how can a light bulb api be adapted to a thermostat. There seems to be a huge mismatch in concepts and functionality.

@LukeDefeo I think you are getting distracted by the api side of things, the core concept of ha-bridge is really very simple (but very powerful).

Typical Hue use

You purchase and install a Philips Hue Starter Kit (bridge and bulbs) in your home.

Now you can turn the lights on and off with your phone, as well as the Hue Dimmer Switch stuck to your wall. Great!

Hue and Echo use

You then buy an Echo which out of the box can detect and control the same bulbs you already control with the app.

This is built in to the Echo and you do not need to use the Hue Skill for basic control.

You can say "Alexa, turn off the living room lights" and "Alexa, dim the living room lights to 40%" and she will. Super!


Ok, so we know the Echo can control Hue bulbs, what's the big deal?

ha-bridge gives you the ability to create software based "fake Hue bulbs"

These fake bulbs are seen by the Echo and treated as if they were physical Hue bulbs, and like physical Hue bulbs you can send ON, OFF and DIM commands to them

ha-bridge allows you to set what you want it to do when the fake bulb receives each of the three commands (you can fire a script, make a http request, press a Harmony button etc, the possibilities are endless)

e.g.

  • Receive ON command: do this thing
  • Receive OFF command: do this other different thing
  • Receive DIM command: do this other thing and send the value (number or percentage) as well

It doesn't matter what the fake device does, as far as the Echo is concerned it has just turned a bulb on.

This means you can create a voice controlled switch for pretty much anything as long as you can do it with a computer :)

Can you see the attraction and power now? :)

@digiltd Great write up! might put that as the intro in the README....

@digiltd
Wow, perfectly put!

Thanks @digiltd That is a nice write up and that should deffo go in place of the sentence i quoted in my initial issue.

I presume you chose HUE as your facade API since its a fairly popular product that many other smart home controller hubs have integrations with so it covers a lot of ground?

Ill read into HUEs api to see how it might map to my problem.

In your first post you don't actually mention using an Echo or Home device.

Are you looking to use the Harmony Remote to control the Netamo thermostat via ha-bridge?

I just had a quick look at my Harmony and it does indeed see all the "fake bulbs" i have set up. It also lets me control them. However the experience is super crappy, no fault of the bridge, it is super crappy even for its intended purpose (controlling the lights). I would it would be very tricky to try and use it to control a thermostat.

Do you have Hue bulbs to have a play with the Hue controls on the Harmony? If not then I recommend getting ha-bridge setup so you can create a "fake bulb" for the Harmony to detect. This will allow you to see how crappy the Harmony Hue control before you investigate the Netamo api side :)

@digiltd Are you wanting to put your write up you have here on the wiki? Then we can close this issue.

sure

@digiltd Thanks man, you are helping out a lot

@digiltd I put your scenario explanation in the FAQ. Closing

Ah, just spotted that. I had already added a page on the wiki expanding on what I wrote here. Unless you have any objections I will remove the bit from the FAQ and replace with a link to the wiki page :)

What ever makes the most sense. Just put out the 4.3.0 release

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lorccan picture Lorccan  路  4Comments

MallocArray picture MallocArray  路  3Comments

sieropoli picture sieropoli  路  4Comments

oktane83 picture oktane83  路  15Comments

pattont picture pattont  路  5Comments