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

(mac user) Initialize lights no respond #24

Open
owenchiouu opened this issue Apr 29, 2024 · 10 comments
Open

(mac user) Initialize lights no respond #24

owenchiouu opened this issue Apr 29, 2024 · 10 comments

Comments

@owenchiouu
Copy link

Hello! I have no coding background and I'm trying to use this TOX on touchdesigner.

The Link to Bridge process worked where the DeviceUserName and ClientKey appeared after linking, but after clicking initialize lights nothing happen and so the control doesn't work at all.

Things I think that might have caused the problem:

  1. Mac M3 Pro?
  2. I uses two lightbulbs: a philips hue white light/innr colour bulb that can be used on philips hue
  3. An updated was installed while setting up the philips hue bridge

Thank you for this code, I really wish it could work for me as it is so porwerful and I would benefit greatly using this for my bachelor degree show!!! Wondering if anyone might know what happened? Thank you, once again

@owenchiouu
Copy link
Author

Screenshot 2024-04-29 at 21 18 44 after connecting, nothing happens after pressing Initialize Lights

@raganmd
Copy link
Owner

raganmd commented Apr 30, 2024

hi @owenchiouu - thanks for logging the report here. After you've initialized lights what do you see on the control pages for "all lights" and "individual lights"?

Usually it's getting this far that's the hard part.

You might also try saving your project network, and then restarting to the project to see if there's a problem with the initial connection.

You can also remove this TOX, and start the connection process over again. If there was an issue due to a system update that should resolve that problem.

@raganmd
Copy link
Owner

raganmd commented May 6, 2024

hey @owenchiouu - I'm going to give this issue a few more days, and then I'm going to close it since I haven't heard back about if there need to be any changes.

@owenchiouu
Copy link
Author

owenchiouu commented May 7, 2024

Hi @raganmd ,
Sorry for not updating on my side!
So for now I have tried to save/reconnect, and as usual I have the device user name and client key up after connecting succesfully. However, the initial light pulse seems to not do anything :(
I have also tested on another laptop, but I think the main reason here is that I'm using mainly a Philips hue warm white bulb, where only the brightness can be controlled. Not sure!
IMG_6822
IMG_6823
IMG_6824
Screenshot 2024-05-07 at 22 13 14

Thank you once again, and attaching some screenshots and pictures :)

Screen.Recording.2024-05-07.at.22.07.40.mov

0">

@raganmd
Copy link
Owner

raganmd commented May 7, 2024

@owenchiouu interesting - I haven't tested with only the warm lights. So there could be something there. Unfortunately, I don't have one of those to test with.

Can you share a screen shot of what you see on this tab of the hue tox?

Screenshot 2024-05-07 161147

Also - is anything printed in the text port?

It does seem like we're doing a handshake with the hue bridge and lights, so that's good news... I just don't happen to know if the warm lights behave differently than the full color lights.

@raganmd
Copy link
Owner

raganmd commented May 8, 2024

@owenchiouu - your video finally loaded for me. Now I can see that there's nothing on those pages. That's super strange - do you get any errors? Without having one of these warm only lights I don't have a good way to test what might be happening here.

@VertigoCorp
Copy link

VertigoCorp commented Sep 22, 2024

Hi @raganmd, thank you for addressing the issue of @owenchiouu. I have a comparable situation and can add this textport behavior to the situation, where I have succesfully linked the bridge with a device user name and client key generated.

The all light and the individual lights tabs do not show any newly created parameters after linking to the bridge.
Most of the lights are non-colored only warm/cool white (white ambience), but some of the lights are colored (colored strips in mono-color and in multi color gradient).

When running the Initializelights command, the Textport returns:

running Initializelights
Traceback (most recent call last):
  File "</project1/base_hueControl/pargroupexec_hue_controller>", line "args[0].Add_pars_for_lights()"
  File "/project1/base_hueControl/TDHueControllerEXT", line 234, in Add_pars_for_lights
  File "/project1/base_hueControl/TDHueControllerEXT", line 239, in _add_light_pars
AttributeError: 'NoneType' object has no attribute 'get'
python >>> 

TouchDesigner Build 2023.11600 compile on Mon Mar 4 18:23:05 2024, on Macbook Pro M3
Python 3.11.1

Furthermore I have a Hue account to get to the bridge-app on phone.

Would you have any clue in a solving direction?

@raganmd
Copy link
Owner

raganmd commented Sep 22, 2024

@VertigoCorp - I think the issue here is probably anchored in the difference for the lights that are warm / cool rather than RGB. I think the only way to get to the bottom of this is to test with one of those fixtures.

How comfortable with Python are you? Happy to point you to where you might make some updates to the extension code.

@NilsJohannesson
Copy link

NilsJohannesson commented Sep 24, 2024

@raganmd I did some research after getting the same issue on windows. I have both rgb and ambiance white lamps so could see the difference quite clearly. I was trying to adjust the code to account for the different json data but I'm not a python expert and figured it's better to tell you about it since you know it better.

For an rgb light the color response looks like this (the one you know):

            "color": {
                "xy": {
                    "x": 0.4622,
                    "y": 0.2982
                }, etc etc

and for ambiance light it looks like this (instead of xy it uses mirek values ??)

            "color_temperature": {
                "mirek": 406,
                "mirek_valid": true,
                "mirek_schema": {
                    "mirek_minimum": 153,
                    "mirek_maximum": 454
                }
            }, etc etc

I'll include the full responses below. Hoping this makes the changes very obvious for you. I am not familiar with the term mirek or how that translates to color temps, but it seems like gradient going from 153 (cold) to 454 (warm).

Hope this helps!

Cheers,
Nils

RGBLight_response.json
AmbianceLight_response.json

@raganmd
Copy link
Owner

raganmd commented Sep 24, 2024

@NilsJohannesson oh sheesh.

So fun fact about phillips Hue RGB lamps color is represented as an xy value on the device, which has a conversion that looks like this:

https://gist.github.com/bgromov/d721f020694abda3ad3dba0c49113376

You'll see in the extension that I currently convert from a set of color pars to xy, and back to pars to make this bit work.

It looks like the color temperature fixtures instead use a Mirek color temperature that's instead represented as a single integer in the range of 153 to 500.

That does give me a better hint here - I can't say for sure when I'll be able to update this. I'd probably need to get my hands on a lamp to actually test, and I need to rethink how those parameters get generated to account a different control schema.

🤔

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

No branches or pull requests

4 participants