Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose a custom color #4

Closed
djacobson opened this issue Oct 8, 2021 · 15 comments
Closed

Choose a custom color #4

djacobson opened this issue Oct 8, 2021 · 15 comments
Assignees
Labels
enhancement New feature or request

Comments

@djacobson
Copy link

Just a question about custom colors...

I see choosing them does not appear to be implemented but, is it implemented in pywizlight either? Experimenting with the color gradient chooser in the WiZ app, the colors don't appear to be "really", in that the app has predefined "color names" for pretty much every position on the gradient (i.e.: Dark Red, Navy Blue, Harlequin, etc.)... so, when one adds a "custom color", is that just giving it a predefined scene_id maybe? ...or maybe those are just color nick-names Philips hard-coded in their iOS app? Just wondering if those colors might be setable by the scene_id parameter after added (if the scene_id param could go above 32)... ?

@djacobson
Copy link
Author

Or maybe the best approach would be to add an RGB parameter to wizcon? i.e.: await light.turn_on(PilotBuilder(rgb = (0, 128, 255)))

@rgomezjnr
Copy link
Owner

Hello again. pywizlight does support custom RGB colors. I'll add it to wizcon, it should be simple.

@rgomezjnr rgomezjnr added the enhancement New feature or request label Oct 8, 2021
@rgomezjnr rgomezjnr self-assigned this Oct 8, 2021
@rgomezjnr
Copy link
Owner

I added the -rgb argument in version 0.3.0.

pip install wizcon --upgrade

usage: wizcon [-h] [-si {1-32}] [-b {0-255}] [-rgb {0-255} {0-255} {0-255}] [-v] IP {ON,OFF,SWITCH}

-rgb {0-255} {0-255} {0-255}, --rgb {0-255} {0-255} {0-255}
Set RGB color of smart bulb

Set smart bulb color to blue:
wizcon -rgb 0 0 255 192.168.1.100 ON

If it's working well for you, can you please tell me your Philips WiZ bulb model, firmware version, and model ID so I can it to the supported bulbs list?

@djacobson
Copy link
Author

Oh awesome!! Will post my bulb info asap.

@djacobson
Copy link
Author

It works beautifully! I'm testing this with a fun script that sets the lamp color to a gradient hue based on the outside temperature every 10 mins or so. :)

Here's my bulb info:
A Phillips Full Color WiZ bulb
Model: A21, Colors
Current FW Version (is this updateable?): 1.24.0
Model ID: B23078

@djacobson
Copy link
Author

djacobson commented Oct 9, 2021

Testing the RGB parameter with my bulb above, it's kind of interesting. It seems as though the bulb does not display as many minor color changes and hues but, the predefined scene colors are much more noticeable. It's like Phillips figured out what colors the bulb was best at displaying and assigned those to scene IDs.

If you're interested, I could share my bash script with you. It might make a good test for wizcon and setting various rgb colors? I'd certainly consider moving it to Python but, originally it was just two sys cmds; 1) get the weather temp, 2) call wizcon.

@rgomezjnr
Copy link
Owner

Glad it's working for you. I'm not sure the firmware is updateable, I don't see any way of doing so in the WiZ app. Sure share your temp bash script, I'm curious.

@djacobson
Copy link
Author

My hacked-together script uploaded (weather_bulb.txt -> change extension to .sh). You can kinda see what I'm trying to do... Scenes vs RGB colors are an interesting comparison in the actual bulb settings. I have this running on a crontab every 10 mins or so.

weather_bulb.txt

@rgomezjnr
Copy link
Owner

Interesting script, thanks for sharing. I'll close the issue now, lmk if you have any additional feedback.

@djacobson
Copy link
Author

djacobson commented Oct 20, 2021

Just a follow-up on this topic. I found this very interesting link listing Hue's bulb colors that have been tested...
https://www.reddit.com/r/googlehome/wiki/hue_colors#wiki_hue_colors
...and
https://www.enigmaticdevices.com/philips-hue-lights-popular-xy-color-values/

Colors are pretty complicated with Hue bulbs. I have modified my script to use more obvious color on the temperature gradient that are obvious at almost any brightness IMHP. The above article attempts to control colors at a much more hi-fi level than my simple example.
weather_bulb.txt

@rgomezjnr
Copy link
Owner

Thanks for sharing. I'm not sure if the Wiz bulbs have the same color support as the Hue bulbs. I've seen in the product pages of Hue bulbs advertise support for 16 million colors, while on Wiz bulbs it just says millions of colors. Still those are nice color charts you linked that should serve well as quick references.

@djacobson
Copy link
Author

djacobson commented Oct 21, 2021

I get confused sometimes because there are the older Phillips Hue 'smart' bulbs, that require the Hue bridge, and then there are the Hue 'smart' bulbs "WiZ connected"... wifi bulbs that do not require a Hue bridge (which I've been primarily experimenting with). Makes me wonder if they are separate markets? ...or the company is expecting more of a future in wifi-only products, etc. Scratching my head... :) I would add that my WiZ bulbs have been very reliable and I have not seen them drop off my wifi, unlike some other devices. I did have an issue with the WiZ smart plug though.

@pierre-guillot
Copy link

Ho to wizcon team.
Thank you so much for this beautiful python script. I installed this on my Raspberry Py and use it with my Domoticz server.
Use just one C37 Wiz Bulb and wizcon can perfectly change every scene number without problem.
But color seems to not work with every rgb code. Tested some rgb based on @djacobson link :

  • Blue/Gree/Red with only one "255" works
  • Aqua (0,255,255) work
  • Yellow (255,255,0) work
  • Magenta (255,0,255) work
  • Black (0,0,0) not work and put light to similar "warm white" scene
  • Chartreuse (128,255,0) seems to made a green color but it's not noticeable , same happened whit Crimson (213,0,53)
    Regards

@rgomezjnr
Copy link
Owner

Hello @pierre-guillot thanks for your input.

I think there is something wrong with colors in pywizlight which is the library that wizcon uses for controlling Wiz bulbs. I know they have recently made a number of changes to handling colors.

Here is my experience from testing with pywizlight 0.3.4, then updating to pywizlight 0.4.16:

Black RGB(0,0,0) did nothing, no color change

Chartreuse (128,255,0) seems ok to me, color is mellow lime green.

(213,0,53) looked more like hot pink magenta.

Crimson (220,20,60) looked more like pink, was expecting closer to red.

  • Updated to pywizlight 0.4.16

Black RGB(0,0,0) went to bright harsh white, like Cool white scene.

Chartreuse (128,255,0) produced much lighter whitish-green. Seemed more accurate before in pywizlight 0.3.4.

(213,0,53) now very white washed, very little pink or red color. Seemed more accurate before in pywizlight 0.3.4.

Crimson (220,20,60) was nearly the same as (213,0,53), no noticeable difference. Way worse now than in pywizlight 0.3.4.


wizcon 0.3.0
pywizlight 0.3.4 -> 0.4.16
Bulb:
Model Model ID Firmware
A19 (RGB) 1.24.0 23007


There is currently an open issue which may be related to this behavior: Three channel RGB not displaying correctly. The developer of pywizlight @sbidy said this would be corrected in the next release.

@pierre-guillot
Copy link

Good news thank you for your replay!
I'll waiting the new version of pywizlight and test again.
Ask me if you want more test or informations :)
regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants