General Ha-Bridge Guide (Hue Bridge for Alexa or Google Home)

@BarryHampants

I was using 4.1.4. Knew there’s a new version just now.
Have just upgraded and removed the auto-restart. Will give it some time maybe report the results later.

Well I’m not sure if it’s happening to me now or or it’s because I’ve just updated to 0.39 but Ha Bridge doesn’t seem to pick up anything from Hass for me - just rebooting my pi now. I’ll let you know…

EDIT: @yungling - after a reboot it’s back so I suspect I’ll be needing an auto restart too.

Before HA bridge stops working like in the 4.1.4, i found, in 4.2.0, after some time (~2 min), the first call of service wouldn’t work. You have call the service for the second time for HA bridge to work.
I kind of think it is even worse than the old version- at least it lasts for 10-15 min…

Gonna try it out more to decide whether i go back to 4.1.4. Keep everyone updated.

Also just installed 4.2.0 and removed the restart. Let’s see if that fixes the problem. @yungling: to do the restart every 15 mins, I just did a ‘sudo crontab -e’ (to run as root) and added ‘*/15 * * * * systemctl restart habridge’.

With version 4.2.0 HA-Bridge has been running for 4 hours now without hanging, which looks promising. I still have the problem where it does not respond all the time, although Alexa responds with okay. The message I get in the syslog is:

Feb 27 15:54:17 ubuntu java[1271]: 2017-02-27 15:54:17,980 [qtp335713384-25] WARN com.bwssystems.HABridge.plugins.http.HTTPHandler - HTTP response code was not an expected successful response of between 200 - 299, the code was: HTTP/1.1 504 Gateway Timeout

@Ide,

Yes the not always responding is what bugging me. That’s why i switched back to 4.1.4 with auto-restarting. Now it seems working quite well.

bws is already aware of this issue and are working on a fix (retry when receiving a 504 timeout), see issue #501. 4.2.0 otherwise still running stable.

Great to know. Looking forwarding to the fix!

Is there anything further needed to add to the config for Hass items to control dimming?

I’ve added my Hass lights (LimitlessLED’s) and the turn off and on reflects in Hass correctly but I’m finding the dim function doesn’t get updated in Hass. It constantly shows the light at 255 brightness.

The command for the dim items is the same as the on command so not sure if that’s entirely right?
Should I be adding something else to control the dimming?

4.2.1 is available! So far so good…

Thanks for informing! Will try over the weekend! :slight_smile:

4.3 is now out… has anyone tested?

I upgraded to 4.3.1 this morning. Worked pretty well. The “hang after 10 min” issue seems gone now.

I upgraded yesterday (4.3) and it hasn’t stopped since, so it’s looking good :slight_smile:

Since the major changes to the UI I am getting somewhat confused as to whether or not we need, and where to enter the URL. If at all?
The new bridge seems to build a home assistant device okay for on and off but I am struggling with getting the dim function working correctly. I am trying to set the volume on a Sonos and before we would put a URL for volume_set but now we don’t seem to be able to add this URL?

Has anyone worked out the new format now in the new bridge? If so can anyone give some examples that cover on off and volume set for a media player device as an example?

Attached is a screenshot of what I have so far. This is for volume set only as on and off seem to work okay when you build the device

Any help much appreciated.

Try this for your dim settings… Leave the on and off as is.

Type: HTTP Device
Target: http://localhost:8123/api/services/media_player/volume_set
Http Verb: POST
Http Body: {"volume_level":".${intensity.percent}", "entity_id":"media_player.living_room"}
Http Headers: [{"name":"X-HA-Access", "value":"PASSWORD"}]
Content Type: application/json

You can now use ${intensity.decimal_percent} too instead of the decimal .${intensity.percent}
so
{"volume_level":"${intensity.decimal_percent}", "entity_id":"media_player.living_room"}

Hi Barry, many thanks for this it worked a treat.

Hi All,

Hoping to get some help, i’ve had HA-Bridge and Home Assistant working well to turn lights on/off for some time now (using LimitlessLEDs/MiLights).

However, sometimes people change the color of the light using the app/remote which is annoying. I wanted it so that the default color and brightness is set on the lights every time HA-bridge calls the light. I have tested the commands I would like to be sent with the code by calling the service directly in Home Assistant.

Home Assistant code: {“entity_id”:“light.hallway”,“color_temp”:400,“color_name”:“white”}

I have tried to translate this into the HaBridge

Type: HomeAssistant Device
Target: HomeAssistant
Target Item:
{“entity_id”:“light.hallway”,“hassName”:“HomeAssistant”,“color_temp”:400,“color_name”:“white”,“state”:“on”}

However, it doesn’t appear to do anything except turn the light on and retain the previous settings (e.g. if the light was red, it remains red).

I looked at the examples in this list, however they appear to all use direct HTTP connections vs. the Home Assistant integration.

Could someone please share a screenshot of their setup for dimming hue lights? I’ve got it working perfectly for on/off but seem to have lost the ability to dim since upgrading (now running 4.3.1)

once u click on the HomeAssistant Device tab you need to select “pass thu value” from the drop box above where it shows the entity ID’s. kinda easy to over look hope this helps