Closed SmartM-ui closed 3 years ago
Anyone know how effects work? I have no idea. Maybe we need DPS dumps when different effects are activated?
Anyone know how effects work? I have no idea. Maybe we need DPS dumps when different effects are activated?
Hi! These are the effects of the smartlife app
Question is how we translate this into something we can send to the bulb .
Ok, so scenes are manged by DP 25 according to:
Maybe we can just try to set 25 to Night
or night
(or any of the others) and see what happens?
Here is what dps 25 is set on my RGBW Led strip:
"25": 07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000
Night or night will not work i must admit. Also, i have multiple bulbs, they all have different scenes.
"21" is set to scene and Colored scene: "25": 05464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000 Night scene: "25": 000e0d0000000000000000c80000
Available scenes in this one: Night, Reading, Work, Soft, Colored, 3 others (do not know how to translate in English ;-))
Right, so the scenes are probably encoding of various changes to colors, brightness and temperatures. So we could probably build our own scenes if we figure out the format. I noticed 03e8
(1000 in decimal) which is likely maximum brightness. Wouldn't be surprised if we found HSV or RGB encoded colors in there...
I dug a little bit into the scenes and here are my findings about simple scenes, white only
Night:
000e0d0000000000000000c80000
Work:
020e0d0000000000000003e803e8
Read:
010e0d0000000000000003e801f4
Loisir:
030e0d0000000000000001f401f4
Loisir brightness 100%
030d0d0000000000000003e801f4
Loisir brightness 100% colortemp 100%
030d0d0000000000000003e803e8
03 0d 0d00000000000000 03e8 03e8
two first, index of the scene
two next, 0e if default, 0d if modified
last 4 color_temp
the 4 before brightness
edit:
Loisir brightness 50% color Red Sat 100%
030d0d00016803e801f400000000
Loisir brightness 100% color Red Sat 100%
030d0d00016803e803e800000000
Loisir brightness 100% color Red Sat 50%
030d0d00016801f403e800000000
030d0d00 0168 01f4 03e8 00000000
HSV (360, 500, 1000)
Continue digging.
Here is what dps 25 is set on my RGBW Led strip:
"25": 07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000
Night or night will not work i must admit. Also, i have multiple bulbs, they all have different scenes.
"21" is set to scene and Colored scene: "25": 05464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000 Night scene: "25": 000e0d0000000000000000c80000
Available scenes in this one: Night, Reading, Work, Soft, Colored, 3 others (do not know how to translate in English ;-))
Hi @ultratoto14 @postlund I'm back. I saw that you worked during my absence!
I try to carry out some tests too, re-enabling debugging. Is there a possibility to enable debugging for only one light bulb? Between the switches and the other bulbs, the log is difficult to read.
My scenes are as follows: night, read, meeting, leisure, soft, rainbow, shine, beautiful
Thanks!
What you can do is just a grep on the log as the logs contains the bulb id =>
tail -f home-assistant.log | grep yourid
What you can do is just a grep on the log as the logs contains the bulb id =>
I wanted to avoid generating too heavy a log. OK, I'll use debugging only when needed for the various tests.
I use a sensor to debug the DP 25, look this #135 and the fix #138
I use a sensor to debug the DP 25, look this #135 and the fix #138
The fix https://github.com/rospogrigio/localtuya/pull/138 has also been implemented here: https://github.com/rospogrigio/localtuya/pull/129
Which one should I try tonight?
They are not linked, #129 is for white home assistant scenes and #138 may help you debug the tuya scenes ;-)
Hi @ultratoto14 pull 138 is about "string sensor" (https://github.com/ultratoto14/localtuya/tree/string_sensor) and you can download the code to try (localtuya-string_sensor.zip) and not debug for tuya scenes.
This is why I was asking which .zip to install to perform the tests: localtuya-string_sensor.zip or localtuya-light_scene_fix.zip Confusion :-)
I bought an rgb led strip yesterday, I can also turn on music modes and stuff like that, will this also be contrable with this PR?
There is no PR yet, the music mode is using the mic of the phone, so it will not be available with HA for the moment
Hmm, quite sure that's it's not using the mic of my phone :-)
I think the wifi controller of the led strip has a mic... When I clap my hands , I see the rgb strip flashing, ist cool for kids :+)
I also have one, i'll try ;-)
For my led strip, it is linked to the phone, if you can confirm that yours is using only the led strip (i tested with my phone in the fridge ;-))
yes, my phone was 1 floor down, closed all doors
i have this RGB strip :https://nl.aliexpress.com/item/4000103478758.html?spm=a2g0s.9042311.0.0.4b0f4c4dXqJrSP
@SmartM-ui , @pergolafabio you may try this PR: #146
@ultratoto14
will do, but i removed localtuya for now i have an RGB led strip, when it drops the wifi, its not coming back to HA
in the HA log, i see every 5 mins disconnect warning, but it doesnt reconnect i have to restart HA to make it work again... strange, because i can still ping it, also the IP are static (dhcp MAC reservation)
with tuya cloud , its stays working
@SmartM-ui , @pergolafabio you may try this PR: #146
@ultratoto14 Hello, my friend! I'm away for work and I'm coming home on Friday night. As soon as I can I try your new PR and it will get feedback. See you soon and don't have fun without me :-)
PR is merged, you can check on your side and close the issue if it is satisfying. @SmartM-ui I initiated a wiki page for known working devices, if you can give the specifications of yours, i can then add them to the list.
Perfect, it seems to work!
The scene string is documented here: https://developer.tuya.com/en/docs/iot/product-function-definition?id=K9s9rhj576ypf#title-8-DP25%3A%20scene Tested this with tinytuya and it works.
This will allow implementing the sliders that the tuya app has for these effects/scenes: speed, brightness, and saturation. We can create custom scenes that Tuya app doesn't provide. Maybe we could even make some sort of scene editor.
@rospogrigio @postlund @ultratoto14
Hi, I remember that by setting the value to 63 of the bulb supported features (in local tuya I see the value 19) the "effect" menu was displayed, as happens in the original Smart Life app.
In the other custom component (Tuya Custom) even though the scene menu was displayed, it was still empty.
Could you bring the scenes from the Smart Life app back to Local tuya?
It is not an indispensable function, but it would be an added value.
homeassistant: customize: light.xxxx: #entity name supported_features: 63