-
Notifications
You must be signed in to change notification settings - Fork 583
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
Scene support for lights. #146
Conversation
52e5080
to
6e07a55
Compare
follow |
@SmartM-ui to be notified on this PR you can just use the subscribe option on the right side of the PRs. |
@SmartM-ui feel free to test this one if you have time 😄 |
Hi @SerAlbi, some steps you can do:
Once you saved the mapping, post the result here, please. P.S. can you also check your logs and put here the error you receive when you change the color ? |
Hi @ultratoto14 , done all the steps. I simply added a sensor to the yaml config since that's what i use an this is what i got (already replaced in the dictionary):
Applying this to the code seems to make the scenes work correctly in my case :) This is the log when i try to change the color while in scene mode:
This is the log when i try to change the brightness:
|
Hi @SerAlbi so, it confirms what i was scared about. I dumped the scenes from known devices (i have multiple ones from different manufacturers). It seems that yours are different in the light strip at least. For the color/brightness error, will check tomorrow, I think I know why, stay tuned. |
Thank you very much :) i'll keep you updated if i discover something else. |
33b433d
to
8d91d92
Compare
Hi @SerAlbi, tried to reproduce your error, and didn't succeed. Can you paste here the yaml configuration of the specific device ? I can still protect the code to ensure the exception will not throw but i would prefer understanding how it happened first 😄 |
Ok, @ultratoto14 this is my configuration under 'localtuya':
The way the error is show is as follows:
Could it be that my leds do not return the color/brightness info if they are in scene mode? So they would need to be turned back to 'colour' before they can return any data... it's a bit confusing. |
Thanks, I reproduced it. |
@SerAlbi can you test last commit, it should fix the brightness/color errors. |
Hi, @ultratoto14 I tested the new version and it's working perfectly! I'm so pumped lol |
Hi @ultratoto14 See you later! |
Hi @SerAlbi I just added the scenes related to your RGB only strip, you can check if it works for you. |
Hi, @ultratoto14, after some testing it's all working perfectly :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested all the scenes for my light bulbs and led strips. They are all working correctly. Switching modes from scenes to colour/white is working aswell.
Works very well! TNX! |
I will review later tonight. |
@ultratoto14 ok how can I do that? @postlund maybe you can help? |
@rospogrigio, i already asked @postlund, he redirected me to you 😄 |
Done... even if I'd prefer to add you as a collaborator, rather than letting anyone edit the wiki... |
@rospogrigio it could be that also, opening the wiki to every one is a bit big. |
OK you've been invited! Welcome onboard! 😄 |
Thanks it will be more secure like that. |
Great to have another pirate on the ship! 🏴☠️ |
Hi @ultratoto14 |
@SmartM-ui no need it should be fixed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
We go by the premises that you only approve PRs and let the author merge. So I leave that to you. |
Hi @ultratoto14 |
Hi @ultratoto14 GEORGEUS DAZZLING COLORFUL SOFT LEISURE WORKING READ NIGHT Where should I enter this data to try scene: 6 ? Thanks |
For the moment not possible, in near future we will find a way to override predefined scenes. |
Excuse the misunderstanding @ultratoto14 |
@ultratoto14 i stored some data from known device in the code, it is temporary. |
Hi,
In practice, when I choose a scene from the menu, instead of being shown the selected scene, a scene with the name "custom" is shown and, obviously, the scene is not reproduced and there is not even the possibility to turn off the light bulb through Home Assistant, except by restoring it to a recognized color Log: I have no problem with bulbs that use 24 color mode PS for info, I have pull # 171 and not pull # 146 Thanks |
@SmartM-ui Yep, it's because the scene of your light is not recognized by the integration. |
Hi, The bulbs in which the scenes do not work have these modes (some titles in English, others in Italian): Is it possible to add them in the integration? |
@SmartM-ui, sorry for that, but we will need to have the db, currently the scenes are stored as dictionary in the light.py. We don't want this file to become a db of all existing scenes. So we will need to wait for the #181 to be implemented. |
OK! I tried trivially to put the names of my scenes in the light.py, but it still doesn't work. I will wait for #181. |
* Revert and use target precision. * Auto configuere Fix default name if prefer_type is dict. * Fix max/min temps.
* Rather than send 2 commands each on it own, now sends both of them togather.
* Black format
This PR is adding basic supports of scenes for tuya lights.
We cannot get the scenes from the lights.
So this PR uses default scenes stored in the app for both RGB and HSV light bulbs.
If a scene is modified in the app, it appears as custom and but could not be use in a home assistant scene.
The music mode is also added but should only works with specific hardware that have a mic.