Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

URI resources in the config.json file don’t seem to imply the exclusive use of HSV values.

The communication is roughly as follows:
iPhone -> Apple Home App or Eve --HSV--> HomeKit --HSV--> Homebridge --HSV--> hombridge-http-rgb-push --RGB--> Your device.

As you see the plugin receives HSV from HomeKit always (and optionally brightness when configured in config.json), translates it to RGB values and a brightness and calls your device.

but I believe there will be no brightness control in the UI

Correct, but I cannot match this with your earlier statement: "The light has RGB capability, so there is no brightness control."
The plugin is written such that if you disable brightness it will indeed tell HomeKit to remove the brightness characteristic from its controls.

Regarding the _setRGB() failed: options.uri is a required argument the error is a bit misleading, but make sure you have set_url correctly set in your config.
Can you paste your configuration?

You must be logged in to vote

Replies: 1 comment · 18 replies

Comment options

Currently, I provide no ability to set brightness (control). I do, however, provide status in the form of a percent derived from RGB values. When I change color, the behavior of the integration changes and RGB gets scaled by either the Home app or HomeKit. HomeKit is something I was vaguely aware of in the context of a dedicated hub, but after reading a bit it appears to be a component of iOS. So, I guess it's an element of the frontend along with Home.

Curiously, when I open the Home app, it knows the correct value of brightness even as Homebridge reports NaN. Here's a screen snippet:

image

Unfortunately, the brightness control is not responsive.

Here's a capture of the Homebridge console output before and after a change of color. RGB scaling is working using the brightness control:

[3/31/2021, 12:03:19 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:19 PM] [MoodLight] Can't read the brightness property! Ignoring the request
[3/31/2021, 12:03:19 PM] [MoodLight] _setRGB() failed: options.uri is a required argument
[3/31/2021, 12:03:19 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:20 PM] [MoodLight] Can't read the brightness property! Ignoring the request
[3/31/2021, 12:03:20 PM] [MoodLight] _setRGB() failed: options.uri is a required argument
[3/31/2021, 12:03:20 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:37 PM] [MoodLight] Caching Hue as 343 ...
[3/31/2021, 12:03:37 PM] [MoodLight] Caching Saturation as 98 ...
[3/31/2021, 12:03:37 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:29 to RGB:4A0116 ...
[3/31/2021, 12:03:37 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:39 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:75 to RGB:BF0439 ...
[3/31/2021, 12:03:39 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:39 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:40 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:60 to RGB:99032E ...
[3/31/2021, 12:03:40 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:40 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:40 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:54 to RGB:8A0329 ...
[3/31/2021, 12:03:40 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:40 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:40 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:48 to RGB:7A0224 ...
[3/31/2021, 12:03:40 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:40 PM] [MoodLight] setPowerState() successfully set to ON
[3/31/2021, 12:03:41 PM] [MoodLight] _buildRgbRequest converting H:343 S:98 B:53 to RGB:870328 ...
[3/31/2021, 12:03:41 PM] [MoodLight] ... _setRGB() successfully set
[3/31/2021, 12:03:41 PM] [MoodLight] setPowerState() successfully set to ON

The config.json file is attached. The file name had to be changed to transfer it.
config.txt

Thanks again.

You must be logged in to vote
18 replies
@Sudo-Rob
Comment options

I understand. It could be the python code I'm using in the light, but I can still use curl to set and get color data and status. I've never seen it fail. Brightness settings have been removed from config.json, but I still report brightness with ON, OFF, and color commands. And on initial startup, Homebridge is still looking for HSV values.

Can you point to any other python code that has a solid interface with HomeKit? I can probably tailor it to the unicornhat library.

Edit: Do you see anything wrong with this?

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 47
Server: Werkzeug/0.14.1 Python/2.7.16
Date: Fri, 02 Apr 2021 16:41:56 GMT

{"brightness":23,"colour":"0D09E6","status":1}

Thanks for trying to help.

R

@QuickSander
Comment options

QuickSander Apr 2, 2021
Maintainer Author

"platforms": [] This is Oké. It is when you will have platform plugins (like nest or any other).

The fact you report brightness and colour with on/off commands is Oké. But you have to specify a regular expression to match the "status":1. This I did not see in your config.

The colour and brightness status must! reply plain text no json format or otherwise.

Can you print the colour reply? E.g. The output of http://0.0.0.0:5000/unicorn/api/v1.0/set as that should return only the hex number.

It is by the way not common to use 0.0.0.0 when you target a host. Normally only used when you start a server. To target your localhost: localhost or 127.0.0.1 (but this has nothing to do with the problem)

@QuickSander
Comment options

QuickSander Apr 2, 2021
Maintainer Author

I've pushed a new version which should be available for you to install.
I fixed one brightness related bug in here, but most importantly it gives more insight in what your light returns and thus will show if it returns an invalid HTTP response.

I've mimicked your config.json for my light and it works in my situation where brightness is simulated by changing RGB:

[4/2/2021, 8:13:23 PM] [HttpPushRgb] power is currently OFF
[4/2/2021, 8:13:23 PM] [HttpPushRgb] ... brightness is currently 100. RGB: ffffff
[4/2/2021, 8:13:23 PM] [HttpPushRgb] ... hue is currently 0. RGB: ffffff
[4/2/2021, 8:13:23 PM] [HttpPushRgb] ... saturation is currently 0. RGB: ffffff
[4/2/2021, 8:13:23 PM] [Homebridge UI] Homebridge Config UI X v4.36.0 is listening on :: port 8581
[4/2/2021, 8:16:56 PM] [HttpPushRgb] power is currently OFF
[4/2/2021, 8:16:57 PM] [HttpPushRgb] ... hue is currently 0. RGB: ffffff
[4/2/2021, 8:16:57 PM] [HttpPushRgb] ... brightness is currently 100. RGB: ffffff
[4/2/2021, 8:16:57 PM] [HttpPushRgb] ... saturation is currently 0. RGB: ffffff
[4/2/2021, 8:17:05 PM] [HttpPushRgb] setPowerState() successfully set to ON
[4/2/2021, 8:17:11 PM] [HttpPushRgb] setPowerState() successfully set to OFF
[4/2/2021, 8:17:14 PM] [HttpPushRgb] setPowerState() successfully set to ON
[4/2/2021, 8:17:19 PM] [HttpPushRgb] Caching Brightness as 74 ...
[4/2/2021, 8:17:19 PM] [HttpPushRgb] Setting brightness via RGB.
[4/2/2021, 8:17:19 PM] [HttpPushRgb] _buildRgbRequest converting H:0 S:0 B:74 to RGB:BDBDBD ...
[4/2/2021, 8:17:20 PM] [HttpPushRgb] ... _setRGB() successfully set
@Sudo-Rob
Comment options

Wonderful. Thanks so much.

I'll install the new version and get back to you.

FWIW, Homebridge, HttpPushRgb, and Home are running on the same host. That's why I'm using 0.0.0.0. There are a few configurations I can try, but I'm changing the python to respond to brightness with plain text. Is that still necessary?

@QuickSander
Comment options

QuickSander Apr 2, 2021
Maintainer Author

I understand you use 0.0.0.0 since it runs locally, but normally that is only used when you serve something. I.e. the server code will bind on address 0.0.0.0. When you are connecting to that same server (running local) you connect using 127.0.0.1 or localhost, not 0.0.0.0. That fact that it works is partly because node probably knows you probably meant 127.0.0.1.

Unfortunately you still have to change the reply for colour to plain text. I can make it to accept a regular expression, but that will need some testing and refactoring for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.