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

L3-5M-P control issues #1394

Open
Oktandrew opened this issue Apr 24, 2024 · 4 comments
Open

L3-5M-P control issues #1394

Oktandrew opened this issue Apr 24, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Oktandrew
Copy link

L3-5M-P behaves weirdly, when using custom colors, you can control the RGB color, or the brightness, but not both.
Setting the RGB color sets the brightness to 100%
Setting the brightness sets the RGB to a seemingly arbitrary value of, loosely, ~(80,225,255)
Control via the native app works fine.

@AlexxIT AlexxIT added the question Further information is requested label May 1, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 1, 2024

@Oktandrew
Copy link
Author

Oktandrew commented May 1, 2024

Sorry for the low-effort bug report. Here are some diagnostic data:
Online devices:

`Version | 3.7.2 (eb0a208)`
`Cloud devices online | 7 / 8`
`Local devices online | 5 / 5`

(The 1 offline is normal, its just my nightstand which I often manually switch off)

Warning and errors on logs: None related to SonoffLAN
Device diagonstics:
sonoff-led.json

Device debug experiments:

  1. Manually trying to set color Red, RGB=(255,0,0), brightness slider is around 50%. This results in LED becoming Red RGB=(255,0,0), but at 100% brightness:
`2024-05-01 14:36:39 [D] 10017bd6e3 => Cloud4 | {'mode': 1, 'colorR': 255, 'colorG': 0, 'colorB': 0, 'light_type': 1} | 1714563399550`
`2024-05-01 14:36:39 [D] 10017bd6e3 => Cloud4 | DDoS | 1714563399651`
`2024-05-01 14:36:39 [D] 10017bd6e3 <= Cloud3 | {'version': 8, 'init': 1, 'fwVersion': '1000.2.1060', 'switch': 'on', 'lineSequence': {'1': 'g', '2': 'r', '3': 'b'}, 'icNumber': 150, 'icType': 0, 'NO_SEND_TO_APP': 0, 'timeZone': 3, 'colorR': 255, 'colorG': 0, 'colorB': 0, 'mode': 1, 'bright': 46, 'speed07': 50, 'bright07': 100, 'light_type': 1, 'speed08': 50, 'bright08': 100, 'rhythmMode': 2, 'rhythmSensitive': 100, 'speed29': 100, 'bright29': 100, 'speed41': 51, 'bright41': 100, 'speed13': 50, 'bright13': 100, 'speed16': 100, 'bright16': 100, 'speed22': 100, 'bright22': 100, 'speed23': 100, 'bright23': 100, 'speed24': 100, 'bright24': 100, 'speed25': 50, 'bright25': 100, 'speed45': 100, 'bright45': 100, 'speed35': 50, 'bright35': 100, 'speed36': 50, 'bright36': 100, 'speed37': 50, 'bright37': 100, 'speed39': 50, 'bright39': 100, 'speed10': 76, 'bright10': 100, 'speed18': 50, 'speed17': 50, 'colorTemp': 50, 'bright18': 100, 'speed47': 50, 'bright47': 100, 'speed48': 50, 'bright48': 100, 'speed49': 50, 'bright49': 100, 'speed50': 50, 'bright50': 100, 'speed43': 50, 'bright43': 100, 'speed46': 50, 'bright46': 100, 'speed38': 50, 'bright38': 100, 'speed31': 50, 'bright31': 100, 'speed32': 100, 'bright32': 100, 'speed28': 50, 'bright28': 100, 'speed11': 50, 'bright11': 100, 'speed21': 50, 'bright21': 100, 'speed14': 50, 'bright14': 100, 'speed15': 50, 'bright15': 100, 'speed19': 50, 'bright19': 100} | 1714563399651`
  1. One moment later, trying to move the brightness slider further down, to dim (28%). This results in LED becoming Green-ish Blue at approximately RGB=(80,225,255), but the brightness is correctly set at 28%
`2024-05-01 14:36:48 [D] 10017bd6e3 => Cloud4 | {'mode': 1, 'bright': 28} | 1714563408985`
`2024-05-01 14:36:49 [D] 10017bd6e3 => Cloud4 | DDoS | 1714563409087`
`2024-05-01 14:36:49 [D] 10017bd6e3 <= Cloud3 | {'version': 8, 'init': 1, 'fwVersion': '1000.2.1060', 'switch': 'on', 'lineSequence': {'1': 'g', '2': 'r', '3': 'b'}, 'icNumber': 150, 'icType': 0, 'NO_SEND_TO_APP': 0, 'timeZone': 3, 'colorR': 255, 'colorG': 0, 'colorB': 0, 'mode': 1, 'bright': 28, 'speed07': 50, 'bright07': 100, 'light_type': 1, 'speed08': 50, 'bright08': 100, 'rhythmMode': 2, 'rhythmSensitive': 100, 'speed29': 100, 'bright29': 100, 'speed41': 51, 'bright41': 100, 'speed13': 50, 'bright13': 100, 'speed16': 100, 'bright16': 100, 'speed22': 100, 'bright22': 100, 'speed23': 100, 'bright23': 100, 'speed24': 100, 'bright24': 100, 'speed25': 50, 'bright25': 100, 'speed45': 100, 'bright45': 100, 'speed35': 50, 'bright35': 100, 'speed36': 50, 'bright36': 100, 'speed37': 50, 'bright37': 100, 'speed39': 50, 'bright39': 100, 'speed10': 76, 'bright10': 100, 'speed18': 50, 'speed17': 50, 'colorTemp': 50, 'bright18': 100, 'speed47': 50, 'bright47': 100, 'speed48': 50, 'bright48': 100, 'speed49': 50, 'bright49': 100, 'speed50': 50, 'bright50': 100, 'speed43': 50, 'bright43': 100, 'speed46': 50, 'bright46': 100, 'speed38': 50, 'bright38': 100, 'speed31': 50, 'bright31': 100, 'speed32': 100, 'bright32': 100, 'speed28': 50, 'bright28': 100, 'speed11': 50, 'bright11': 100, 'speed21': 50, 'bright21': 100, 'speed14': 50, 'bright14': 100, 'speed15': 50, 'bright15': 100, 'speed19': 50, 'bright19': 100} | 1714563409087`
  1. (This is sort-of unrelated with the issue, but it is still a 'bug') When trying to create a Scene that sets the LED to RGB=(1,9,255), and brightness 46%, there is no way to disable the "Effect" menu, meaning it automatically (and without ever being clicked or interacted with), selected the (default?) value of "Dynamic Music", which in turn makes the LED become music-activated.
`2024-05-01 14:37:03 [D] 10017bd6e3 => Cloud4 | {'switch': 'on', 'mode': 4, 'rhythmMode': 2, 'rhythmSensitive': 100, 'bright': 46, 'light_type': 1, 'colorR': 1, 'colorG': 9, 'colorB': 255} | 1714563423060`
`2024-05-01 14:37:03 [D] 10017bd6e3 => Cloud4 | DDoS | 1714563423160`
`2024-05-01 14:37:03 [D] 10017bd6e3 <= Cloud3 | {'version': 8, 'init': 1, 'fwVersion': '1000.2.1060', 'switch': 'on', 'lineSequence': {'1': 'g', '2': 'r', '3': 'b'}, 'icNumber': 150, 'icType': 0, 'NO_SEND_TO_APP': 0, 'timeZone': 3, 'colorR': 1, 'colorG': 9, 'colorB': 255, 'mode': 4, 'bright': 46, 'speed07': 50, 'bright07': 100, 'light_type': 1, 'speed08': 50, 'bright08': 100, 'rhythmMode': 2, 'rhythmSensitive': 100, 'speed29': 100, 'bright29': 100, 'speed41': 51, 'bright41': 100, 'speed13': 50, 'bright13': 100, 'speed16': 100, 'bright16': 100, 'speed22': 100, 'bright22': 100, 'speed23': 100, 'bright23': 100, 'speed24': 100, 'bright24': 100, 'speed25': 50, 'bright25': 100, 'speed45': 100, 'bright45': 100, 'speed35': 50, 'bright35': 100, 'speed36': 50, 'bright36': 100, 'speed37': 50, 'bright37': 100, 'speed39': 50, 'bright39': 100, 'speed10': 76, 'bright10': 100, 'speed18': 50, 'speed17': 50, 'colorTemp': 50, 'bright18': 100, 'speed47': 50, 'bright47': 100, 'speed48': 50, 'bright48': 100, 'speed49': 50, 'bright49': 100, 'speed50': 50, 'bright50': 100, 'speed43': 50, 'bright43': 100, 'speed46': 50, 'bright46': 100, 'speed38': 50, 'bright38': 100, 'speed31': 50, 'bright31': 100, 'speed32': 100, 'bright32': 100, 'speed28': 50, 'bright28': 100, 'speed11': 50, 'bright11': 100, 'speed21': 50, 'bright21': 100, 'speed14': 50, 'bright14': 100, 'speed15': 50, 'bright15': 100, 'speed19': 50, 'bright19': 100} | 1714563423160`

My understanding of the problem, is that the integration doesn't send a full command, containing both the RGB value and the brightness, and instead sends only the value that changed. Sonoff's servers then probably automatically fill in the 'gaps', setting 100% if the brightness is missing and ~(80,225,255) if the color is missing.

If the LEDs are set to a preset from a Scene, SonoffLAN sends a full command, containing both RGB AND brightness, but it also includes the "Effect", which you cannot disable, because a "None" or "Disabled" option is missing from the drop-down menu for "Effects", meaning that you're actually forced to select one, (which you shouldn't, effects are optional, since they're a different mode, and they override any RGB/brightness set by the user anyway).

@AlexxIT AlexxIT added enhancement New feature or request and removed question Further information is requested labels May 1, 2024
@AlexxIT AlexxIT self-assigned this May 1, 2024
AlexxIT added a commit that referenced this issue May 1, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 1, 2024

I can't confirm your words. I don't have this bulb. But tests say than integration sends brightness+rgb without any problems: eea500d

@AlexxIT AlexxIT removed their assignment May 1, 2024
@Oktandrew
Copy link
Author

Oktandrew commented May 1, 2024

Hello, the integration indeed seems to work fine. I think the problem comes from what the UI is asking the integration to do.
I dug a little deeper and I tried calling sonoff.send_command like so:

service: sonoff.send_command
data: 
  device: 10017bd6e3
  switch: 'on'
  mode: 1
  colorR: 255
  colorG: 0
  colorB: 0
  bright: 10

And it worked! The LEDs indeed turned Red and at 10% brightness.

Then I tried to set just the brightness with:

service: sonoff.send_command
data: 
  device: 10017bd6e3
  switch: 'on'
  mode: 1
  bright: 11

and the LEDs turned into RGB(80,225,255) at 11% brightness

exactly after that, I ran:

service: sonoff.send_command
data: 
  device: 10017bd6e3
  switch: 'on'
  mode: 1
  colorR: 255
  colorG: 0
  colorB: 0

which is missing it's "bright" value. and the LEDs turned Red but at full brightness!

Curiously, I tried the same experiment with my other LED controller by Sonoff, "L2", which is a standalone RGB strip controller, and it doesn't behave that way, instead it 'remembers' the values of RGB and brightness, and doesn't reset them every time a new command is ordered.
But L3-5M-P required all 4 values (bright,colorR,colorG,colorB) to be present, otherwise it would mess up.

I didn't entirely understand the test you conducted earlier, but by sending
await_(light.async_turn_on(brightness=128, rgb_color=(255, 0, 0)))
the integration does something which is (as I understand), impossible to do currently with the UI (unless triggered by a scene preset, which has that other glitch I mentioned earlier, making it only usable if you want to use an "effect"), but quite similar, if not identical, to the commands I sent using the Developer tools.

Also curiously, it doesn't seem that anyone else has this issue. It's very hard if impossible to miss, and it would have been caught during development...

Thanks for looking into this.

@AlexxIT AlexxIT self-assigned this May 2, 2024
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

2 participants