Homebridge and Openremote light brightness

Hi everyone,

I’ve managed to set up Homebridge to read switches and their states without issue. However, trying to poll either brightness or volume levels causes Homebridge to crash on startup. Has anyone else seen this?

Jan 2 14:09:26 jeeves homebridge[241]: /opt/node/lib/node_modules/homebridge-openremote/index.js:126

Jan 2 14:09:26 jeeves homebridge[241]: #011#011#011#011#011var doc = new dom().parseFromString(responseBody)

Jan 2 14:09:26 jeeves homebridge[241]: #011#011#011#011#011 ^

Jan 2 14:09:27 jeeves homebridge[241]: ReferenceError: responseBody is not defined

Jan 2 14:09:27 jeeves homebridge[241]: at pollingtoevent. (/opt/node/lib/node_modules/homebridge-openremote/index.js:126:42)

Jan 2 14:09:27 jeeves homebridge[241]: at emitOne (events.js:116:13)

Jan 2 14:09:27 jeeves homebridge[241]: at pollingtoevent.emit (events.js:211:7)

Jan 2 14:09:27 jeeves homebridge[241]: at done (/opt/node/lib/node_modules/homebridge-openremote/node_modules/polling-to-event/index.js:63:20)

Jan 2 14:09:27 jeeves homebridge[241]: at /opt/node/lib/node_modules/homebridge-openremote/index.js:118:7

Jan 2 14:09:27 jeeves homebridge[241]: at Request._callback (/opt/node/lib/node_modules/homebridge-openremote/index.js:152:4)

Jan 2 14:09:27 jeeves homebridge[241]: at Request.self.callback (/opt/node/lib/node_modules/homebridge-openremote/node_modules/request/request.js:186:22)

Jan 2 14:09:27 jeeves homebridge[241]: at emitTwo (events.js:126:13)

Jan 2 14:09:27 jeeves homebridge[241]: at Request.emit (events.js:214:7)

Jan 2 14:09:27 jeeves homebridge[241]: at Request. (/opt/node/lib/node_modules/homebridge-openremote/node_modules/request/request.js:1163:10)

``

Can you include your config file from home bridge so we can see how you have it configured?

Thanks!

The full config.json passes a validation check, and probably no point in pasting those dozen or so working switch accessories here.

The brightness_url and brightnesslvl_url also work when tested in a browser.

The problematic accessory configuration looks like this:

   {

       "accessory": "openremote",

       "name": "Kitchen Light",

                           "switchHandling": "realtime",

                           "http_method": "POST",

                           "on_url": "http://gerald.local:8688/controller/rest/control/634/ON",

                           "off_url": "http://gerald.local:8688/controller/rest/control/634/OFF",

                           "status_url": "http://gerald.local:8688/controller/rest/status/797888",

                   "service": "Light",

                           "brightnessHandling": "realtime",

                           "http_brightness_method": "GET",

                           "brightness_url": "http://gerald.local:8688/controller/rest/control/211/%b",

                           "brightnesslvl_url":"http://gerald.local:8688/controller/rest/status/296138"

  },

``

I’ve also tried changing the polling from “realtime” to “yes”, but the error persists. As soon as I remove the light service section and leave only the switch, homebridge starts successfully.

Which device are you using this for? I can try out the brightness handling piece with a couple of ZooZ dimmers and a GO control bulb I have. Both support dimming but i currently only have homebridge configured to turn them on and off with Siri. In your config file, what is the ID 211 and 296138 for? Are they for a slider tied to the device you what to control the brightness for?

Thanks

I tested this out on my setup and it seems to be working fine for me. Below is my relevant config. I used the IDs tied tot he slider for this dimmer.

,{

“accessory”: “openremote”,

“name”: “Dining Room Light”,

“switchHandling”: “realtime”,

“http_method”: “POST”,

“on_url”: “http://192.168.1.30:8688/controller/rest/control/1087/ON”,

“off_url”: “http://192.168.1.30:8688/controller/rest/control/1087/OFF”,

“status_url”: “http://192.168.1.30:8688/controller/rest/status/588158”,

“service”: “Light”,

“brightnessHandling”: “yes”,

“http_brightness_method”: “GET”,

“brightness_url”: “http://192.168.1.30:8688/controller/rest/control/62/%b”,

“brightnesslvl_url”:“http://192.168.1.30:8688/controller/rest/status/588157

}

from the Home Kit app i can do the dimming and it shows the % value of the dimmer realtime.

From Siir- i have to say

" Hey Siri, whats the dinning room light status" - this returns if light is On or Off

" Hey Siri, whats the dinning room light up to"- this returns the % value of the dimmer"

" Hey Siri, set the dinning room light to 40%"- this sets the dimmer value to 40%

My dimmers are a KNX installation, but I wouldn’t expect the hardware & protocol to make a difference to the output of the slider element in OpenRemote. I use sliders for controlling the brightness of about ten lights in the Controller UI, they all work fine.

The good news from your post is that it _should_ work. The values in the brightness urls are for the slider element and its respective status sensor.

Homebridge itself is running on a raspberry pi zero w, and OpenRemote on a separate raspi 3.

I’m frankly quite at a loss of what the root cause for the errors in my installation would be. ARMv6 CPU in the raspi zero? A wrong system locale? KNX protocol? Clearly the status url parser correctly identifies the switch status messages...

In any case, a humble thank you for your help!

I don’t think it should matter but I am running both the OpenRemote controlller and home bridge on the same raspberry pi 3

I tried a second install on a raspi3 instead of the zero, but it made no difference. A brand new Homebridge installation fails in the same way, so at least the armv6 / armv7 difference is not the reason.