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
Support light transition on LED strips #404
Comments
Hello @lupusbytes, In order to use the service, beside the obvious fields (following the developer service panel UI) you'll have to setup a meaningful payload. To start off you might query the actual light state with: service: meross_lan.request
data:
protocol: auto
method: GET
namespace: Appliance.Control.Light
payload: "{}"
device_id: YOUR_DEVICE_UUID then, in order to send a command just switch the method to SET and put a valid/experimental payload in it. In yaml the payload would need to be escaped (for the
Keep in mind, some lights automatically turn on when receiving any As for effects, that's a mess since meross_lan tries to implement sending the command for setting an effect but there were reports it wasn't working (#232) and I had never received any hint or help to try fix it. I hope you could experiment this a bit so that we can (finally) fix this long standing issue and maybe add support for transitions too ;) |
Dear @krahabb After trying to call the API in many different ways I think that I can conclude that it doesn't support transitions in the traditional sense. The effects and "transition" that I am seeing in the app is simply a smooth brightness transition that takes around 1 second and cannot be configured. I uploaded a video of the Meross "Party" Effect for you to see: https://www.youtube.com/shorts/IZyXmvV1zys
This will smoothly turn down the brightness over 1 second, wait 3 seconds and then smoothly turn it up again. I found another repo that was easier for me to read: https://github.com/bwp91/homebridge-meross/blob/latest/lib/device/light-rgb.js
Could it be related to this? While this feature may not enable us to use the normal HomeAssistant transition function, implementing the smooth change would still allow us to script much smoother (longer) transitions ourselves, so that not every brightness step is as instant and noticeable. EDIT: The effects tab actually lets you define the flash speed on a slider, which can be turned very far down to make it extremely slow... 🤔 |
I have been trying for hours to use The following script works on my meross LED strips, but the brightness steps are instant and disturbing and this is why I started researching this thing 😄
I tried so many variations, but I can't make this work with
|
Hello @lupusbytes, Meross lights are driving me mad (still) since, even if they (different models/fw) all expose the kind-of-same interface, their behavior is so erratic... I've bought an msl320 Pro and, beside being finally able to implement effect selection I'm now more concerned than before (more on this later) Back to your findings:
I've tried issuing commands with capacity=1 to just control the rgb value but in the end it is like issuing a command with capacity=5 and replying the current luminance (which is the approach used in meross_lan - I always (re)send the current 'cached' luminance if it is not changed through an HA UI request If I send capacity=7 (which should mean both rgb and cct active at the same time) the light just flashes-out something and then ignores the command actually rejecting this combo as a valid working mode. I'll try experiment a bit more on these capacity mess to see if there are some combo/transitions available but I'm not so confident. As for why your script using meross_lan.request doesn't work, at first sight I see those double-quotes (") around the template calculation for the "luminance" key value which might be producing a string instead of an int for the json value to send and this is likely rejected by the device. I'm not sure about the syntax for the script but you should ensure you're sending an int (correctly bounded though) for the "luminance"...again, not sure if this is the issue |
I think I've found while you can't invoke the service with the template...fact is, the payload is accepted as a string parameter in the service interface and then converted to json inside the service call... |
I was able to finally make it work... alias: New Script (Duplicate)
sequence:
- repeat:
count: "{{ (end_brightness - start_brightness) / step }}"
sequence:
- service: meross_lan.request
data:
method: SET
namespace: Appliance.Control.Light
payload:
{
"light": {
"capacity": 4,
"channel": 0,
"luminance": "{{ start_brightness + repeat.index * step }}"
}
}
device_id: 2104293378215590850648e1e96ec013
- delay:
seconds: >-
{{ transition_time / ((end_brightness - start_brightness) / step)
}}
variables:
start_brightness: 10
end_brightness: 50
step: 1
transition_time: 5
mode: restart but it currently doesn't work on the published release since, as I've stated before, the current/old implementation always tries to interpret the passed in payload parameter as a string since in my experiments/tests the UI always passed in a string (even if it contained a json structured value) |
This sounds very exciting. I'm still kind of new to Home Assistant. I'm running it in a docker container and not sure how to use git to pull integration updates, instead of the normal release channels, but I am very excited to try the feature out! |
I am an owner of two msl320cp LED strips.
In the Meross app, when I change the brightness or color, the lights smoothly transition from one state to the other.
Using meross_lan, it instantly switches from one state to the other.
Automations cannot take advantage of the transitions, like:
Looking around for clues in the code, I found lines like this in the emulator_traces.
2021/10/12 - 19:19:31 http GETACK Appliance.System.All {"all": {"system": {"hardware": {"type": "msl320cpr", "subType": "un", "version": "4.0.0", "chipType": "rtl8710cm", ... "light": {"capacity": 6, "channel": 0, "rgb": 255, "temperature": 46, "luminance": 100, "transform": 0}}}}
Is it possible that the
transform
property is the secret to smooth transitions?The device is certainly capable of creating smooth transitions, with the Meross app.
If you use the effects tab, and choose
Party
, it goes crazy with flashing all the colors of the rainbow, and you can even set the Flash speed and mode.This is another thing that is not supported by meross_lan, but not a big deal for me; You can see the list of effects in homeassistant, but not trigger them...
The text was updated successfully, but these errors were encountered: