OpenWiz icon indicating copy to clipboard operation
OpenWiz copied to clipboard

Dimming not setting properly

Open isaacrlevin opened this issue 4 years ago • 16 comments

Hey there! I assume this is more a light issue than an issue with the library, but I wanted to see if you have this experience. I can update my dimming just fine, but when it is set to 100, it is nowhere near full brightness, and anything more than that gives an error. Here is some sample code to work with.

var command = new WizParams();
command.State = true;
command.Dimming = 150;//_options.LightSettings.Wiz.Brightness;
command.Speed = 0;
command.R = 255;
command.B = 0;
command.G = 0;

UpdateLight(command, lightMacAddress);

private WizResult UpdateLight(WizParams wizParams, string lightId)
{
    WizSocket socket = new WizSocket();
    socket.GetSocket().EnableBroadcast = true; // This will enable sending to the broadcast address
    socket.GetSocket().ReceiveTimeout = 1000; // This will prevent the demo from running indefinitely
    WizHandle handle = new WizHandle(lightId, IPAddress.Broadcast); // MAC doesn't matter here

    WizState state = new WizState
    {
        Method = WizMethod.setPilot,
        Params = wizParams
    };

    socket.SendTo(state, handle);

    WizResult pilot;
    while (true)
    {
        state = socket.ReceiveFrom(handle);
        pilot = state.Result;
        break;
    }
    return pilot;
}

isaacrlevin avatar Feb 23 '21 17:02 isaacrlevin

Hi @isaacrlevin ! I swear I check up regularly, so sorry for the wait. I'll try to get the fix up today.

UselessMnemonic avatar Mar 04 '21 00:03 UselessMnemonic

So after a bit of finessing, I realized that the hue LEDs aren't as perceivably bright as the cool/warm white LEDs.

I played with Params.Dimming (by the way, values here are in [10, 100]) and no max colored LED produces as intense a light. You could try using the white LED's in tandem, but the final color looses a lot of saturation.

UselessMnemonic avatar Mar 04 '21 02:03 UselessMnemonic

Makes sense, except why does the app allow you to have full brightness when you change color

Get Outlook for Androidhttps://aka.ms/ghei36


From: Christopher Madrigal [email protected] Sent: Wednesday, March 3, 2021 6:28:53 PM To: UselessMnemonic/OpenWiz [email protected] Cc: Isaac Levin [email protected]; Mention [email protected] Subject: Re: [UselessMnemonic/OpenWiz] Dimming not setting properly (#2)

So after a bit of finessing, I realized that the hue LEDs aren't as perceivably bright as the cool/warm white LEDs.

I played with Params.Dimming (by the way, values here are in [10, 100]) and no max colored LED produces as intense a light. You could try using the white LED's in tandem, but the final color looses a lot of saturation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/UselessMnemonic/OpenWiz/issues/2#issuecomment-790235952, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACDXTJTTI2VXKCGBFCFU7OTTB3V6LANCNFSM4YC3HZSQ.

isaacrlevin avatar Mar 04 '21 02:03 isaacrlevin

The controls on the app map more or less directly to the parameters for setPilot. I went ahead and selected full bright red on the app. This is part of the result of getPilot:

{
  "method" : "getPilot",
  "result" : {
    "rssi" : -54,
    "state" : true,
    "sceneId" : 0,
    "r" : 255,
    "dimming" : 100
  }
}

I tried manually setting the same color, and I get the same result. Full brightness on the app doesn't correlate to physical brightness.

UselessMnemonic avatar Mar 04 '21 17:03 UselessMnemonic

That is really odd. If I set dimming to 100, like below, the light is nowhere near as bright as setting red in the app

WizSocket socket = new WizSocket();
socket.GetSocket().EnableBroadcast = true; // This will enable sending to the broadcast address
socket.GetSocket().ReceiveTimeout = 1000; // This will prevent the demo from running indefinitely
WizHandle handle = new WizHandle(lightId, IPAddress.Broadcast); // MAC doesn't matter here

WizState state = new WizState
{
    Method = WizMethod.setPilot,
    Params = new WizParams{
    	 State = true,
		 Dimming = 100,
		 Speed = 0,
		 R = 255,
         B = 0,
         G = 0
    }
};

socket.SendTo(state, handle);

WizResult pilot;
while (true)
{
    state = socket.ReceiveFrom(handle);
    pilot = state.Result;
    break;
}

isaacrlevin avatar Mar 04 '21 17:03 isaacrlevin

Which particular bulb are you using? I have tested only with the BR30 model, so perhaps your bulb needs some extra configuration.

Alternatively, how often do you send updates? I find that frequent updates cause the bulb to stop mid-transition.

UselessMnemonic avatar Mar 05 '21 02:03 UselessMnemonic

I have an A19 bulb

Get Outlook for Androidhttps://aka.ms/ghei36


From: Christopher Madrigal [email protected] Sent: Thursday, March 4, 2021 6:09:16 PM To: UselessMnemonic/OpenWiz [email protected] Cc: Isaac Levin [email protected]; Mention [email protected] Subject: Re: [UselessMnemonic/OpenWiz] Dimming not setting properly (#2)

Which particular bulb are you using? I have tested only with the BR30 model, so perhaps your bulb needs some extra configuration.

Alternatively, how often do you send updates? I find that frequent updates cause the bulb to stop mid-transition.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/UselessMnemonic/OpenWiz/issues/2#issuecomment-791092529, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACDXTJSXUPMMNQQRY6OQTXLTCA4MZANCNFSM4YC3HZSQ.

isaacrlevin avatar Mar 05 '21 05:03 isaacrlevin

Could you post a link to the item you bought, by chance? I see a few labeled A19, I just want to be sure I grab the same one.

UselessMnemonic avatar Mar 06 '21 16:03 UselessMnemonic

https://www.homedepot.com/p/WiZ-60W-Equivalent-A19-Colors-and-Tunable-White-Wi-Fi-Connected-Smart-LED-Light-Bulb-IZ0126081/303142930

isaacrlevin avatar Mar 06 '21 20:03 isaacrlevin

Any update here?

isaacrlevin avatar Mar 28 '21 16:03 isaacrlevin

Hi there, sorry about the wait, I've gotten busier with work and I'm having troubles securing a bulb

UselessMnemonic avatar Apr 03 '21 16:04 UselessMnemonic

Did a bit more digging here. It seems that if you increase Dimming to over 100, you will get a an Invalid params message

image

Since 100 dimming is pretty dark, I think the issue is related to not accepting more than 100. For instance, I tried doing this in Python with pywizlight and had no issues setting the dimming to 255.

Disregard the nonsense about dimming over 255, I realized that that pywizlight also uses 0-100

isaacrlevin avatar Apr 06 '21 17:04 isaacrlevin

@UselessMnemonic now that you have a light. Can you try to repro what I am seeing here?

isaacrlevin avatar Nov 10 '21 19:11 isaacrlevin

Same problem with A19 bulb

djniuss avatar Jan 04 '22 12:01 djniuss

Hey @UselessMnemonic coming back here to see if you have had a chance to look at this. I can try to debug, but I am not sure how you debug this issue

isaacrlevin avatar Feb 15 '22 19:02 isaacrlevin

Hello @UselessMnemonic checking to see if had any ideas with the dimming of the A19 bulb

Tungsten66 avatar Apr 27 '23 00:04 Tungsten66