Ha-bridge: Dim feature does not work with Home Assistant

Created on 25 Oct 2016  路  15Comments  路  Source: bwssytems/ha-bridge

I am trying to set this up with Home Assistant.. this is what I have configured..

Name: Lamp
Device type: Custom
on URL: http://192.168.1.9:8123/api/services/light/turn_on
dim Url: http://192.168.1.9:8123/api/services/light/turn_on
off Url: http://192.168.1.9:8123/api/services/light/turn_off
HTTP Headers: [{"name":"X-HA-Access", "value":"password"}]
verb: POST
content: application/json

body On: {"entity_id":"light.arc_lamp"}
body Dim: {"brightness":"${intensity.byte}", "entity_id":"light.arc_lamp"}
body Off: {"entity_id":"light.arc_lamp"}

The dim feature doesn't work at all.. I can turn on and off but no dimming...

bug question

All 15 comments

When you use ${intensity.byte} I assume you need a value of 0-254? if you need 0-100 use ${intensity.percent}. Also, I assume that the "turn_on" command evaluates the dimming in the body.

Yeah I switched it to ${intensity.percent}. But regardless I can't get it to dim by saying "Alexa, dim the arc lamp to 50"

I used hurl.it to send http request using all the same stuff i put into habridge and it works fine. So I am not sure what habridge is sending to my homeassistant that it wont work.

say "Alexa, set lamp to 50 percent"

Yes I tried that.. Doesn't work..

I even took out the $[intensity.percent} variable and plugged in {"brightness":"255", "entity_id":"light.arc_lamp"} and then ran the "Test Dim" and it doesn't do anything.. Well actually it turns the lamp on, but it doesn't set the brightness to 255.

Okay so I made some changes.. I can get the lights to dim now, but when I turn them off and then turn them back on the come back on at full brightness instead of their last set brightness level..

removed Dim URL and Dim Body Content.. and changed ON Body content to {"entity_id":"group.ki", "brightness":"${intensity.byte}"} ..

Is the way this functions is that if you say turn on it uses the on url and on body? And If I say dim it uses the dim url and the dim body?.. It doesn't seem to be working as intended..

That or I am entering the wrong url and body content but that doesn't seem to be the case..

You'll need to turn on debug to see what is happening. With dimming, a lot of it will be the interpretation by Alexa, which I have no control over. Have you used the test buttons to see if it works from there?

Yes I used the Test button to test the Dim feature and it doesn't change the brightness of the bulb.. I used a fixed brightness level 255, not the intensity variable..

Dim URL: http://192.168.1.9:8123/api/services/light/turn_on
Dim body: {"entity_id":"group.ki", "brightness":"255"}

That does nothing to change the brightness... I used an online http request page to send those exact parameters and that worked to change the brightnes.. So I can't see how it can be anything else but the ha-bridge..

I was just checking my home assistant log and it seems as those HA Bridge isn't sending any parameters?..

16-10-25 05:35:11 homeassistant.components.http: Serving /api/services/light/turn_on to 192.168.1.9 (auth: True)
16-10-25 05:35:11 homeassistant.core: Bus:Handling Event call_service[L]: domain=light, service_data=None, service_call_id=1977521424-30, service=turn_on>
16-10-25 05:35:11 phue: {'alert': 'none', 'on': True, 'effect': 'none'}

Any of the content I put in the Dim Body doesn't get passed to home assistant...

I've having the same issue passing off dim values to openhab2 via it's rest api. I simply need to pass an integer value in the body, so i set ${intensity.percent}. However, when alexa responds to "set to 50 %" i end up with full brightness. There is no where in between.

Well, totally blew it on the dim body. It is not being passed, only the off value. This is a bug.

I'm setting up my Echo to control Lightwave RF modules using habridge and nodejs.. all working superbly.. except the Dim functions.. guess I've stumbled upon the bug!! Before I spend ages on a workaround, which I'm happy to do of course, is there any ETA on a fix? Would seem a waste to do all that if a fix is in the pipeline.

Thanks for all your work btw.. terrific sofware.

Not sure if it will help, but have a look at https://github.com/bwssytems/ha-bridge/issues/193

I know it is a bit janky, but it works fine and I am able to send percentages to Kodi over HTTP with "set cody sound to 40 percent". You might be able to take something from that to get the dim working.

Also using Lightwave RF. As a workaround have setup 3 Dimmer moods in Lightwave RF app (3 is the maximum) with different Brightness levels then created 3 devices in ha-bridge Dark (5%), Relaxed (50%) and Bright (100%)

Thanks gents - will certainly take a look at those suggestions

Seems to be working now!! Thanks so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rodders99 picture rodders99  路  28Comments

bwssytems picture bwssytems  路  258Comments

SVLoneStar picture SVLoneStar  路  54Comments

pbrisebois picture pbrisebois  路  30Comments

octoplayer2 picture octoplayer2  路  71Comments