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

RGBW Control #143

Open
buzurk26 opened this issue Nov 7, 2020 · 23 comments
Open

RGBW Control #143

buzurk26 opened this issue Nov 7, 2020 · 23 comments
Assignees
Labels
question Further information is requested

Comments

@buzurk26
Copy link

buzurk26 commented Nov 7, 2020

Hi, Great plugin, got my bulbs into HA finally which is great!

Couple of things i am missing and hope to be able to add are

  • Scene Control (in tuya my bulbs have "scenes" which are essentially differnt colour effects, like random colour cycle etc)
    When adding my lights, there appears to be a dropdown for it, but it does not seem to do anything
    image

image

  • White value control, like this
    image
@ultratoto14
Copy link
Collaborator

ultratoto14 commented Nov 7, 2020

Hi @buzurk26 there is already an issue open about scenes: #131
About the white value, for the moment changing the color_temp is the only way to switch to white.

If you have this configurations options, can you describe the behavior of the white value slider in conjunction of the brightness one ? Are they linked in any manner ? What are the way to go from color to white and the opposite ?

@postlund postlund added the question Further information is requested label Nov 17, 2020
@FeikoJoosten
Copy link

FeikoJoosten commented Nov 23, 2020

I'd like to add onto this. I have a RGBCW bulb which isn't functioning just right either. It seems as if I'm missing an option, and I believe the white value might help out with this. For reference, these are the bulbs I have.

Edit: I had a misconfiguration where I assigned the max brightness as 100 instead of 255. This partially resolves my issue, but I still have an issue where assigning the color White causes the lamp to turn white/blueish. So I still think something is off.

Added a screenshot of my configuration.
image

@ultratoto14
Copy link
Collaborator

Hi @FeikoJoosten, i assume you are using master.

Some questions:

  • What happens when you move the slider of the color_temp ?
  • Can you describe from switch on to the problem, what are the steps you are using ?
  • From the color value here, the bulb is using the RGB coding of color. The scene value seems to be quite long for this coding. Can you also check with the value 6 ?

Now, to help in debugging, I need to first know the boundaries of the light.

Using the tuya app, set the brightness/color_temp/white_value to max and min and each time, using How to get a DP dump write down the values and report here.

Thanks.

@ultratoto14
Copy link
Collaborator

@postlund question for you, when you edit the entity-configuration, the values are not synced, aren't they ?

@postlund
Copy link
Collaborator

@ultratoto14 Currently no, they have values from when the device was initially added. Would be great to fix that...

@ultratoto14
Copy link
Collaborator

@postlund just thinking of a way to easily have DP dumps for users, maybe a configuration option that can add full DPs as an extra attribute, or even as an automatically added text sensor ?

@postlund
Copy link
Collaborator

@ultratoto14 I was working on a debug menu for the config flow to do this a while back, but it got messy and didn't fit in so I abandoned it. My intention is to add it as an attribute to a status sensor, once I get the going. I think I have some base code laying around for it, will se when I can fix and push it.

@FeikoJoosten
Copy link

Hi @ultratoto14, thanks for your response!

Hi @FeikoJoosten, i assume you are using master.

Yes, I'm indeed using the master version.

  • What happens when you move the slider of the color_temp ?

The bulb does change it's color temperature properly.

  • Can you describe from switch on to the problem, what are the steps you are using ?

I switch the switch on using HomeAssistant. And I set the color to white using the color wheel. I have 2 bulbs of this model/type. 1 of which is still synced through Tuya and the other bulb is now synced through LocalTuya. When I do the same with the Tuya bulb it is set properly to a color of white. With the LocalTuya one, it's set to a blue ish white.

  • From the color value here, the bulb is using the RGB coding of color. The scene value seems to be quite long for this coding.

Yeah my screenshot was a bit outdated, as I had now set the scene value to value 6 which properly assigned the scene value.
Up to date screenshot:
image

Using the tuya app, set the brightness/color_temp/white_value to max and min and each time, using How to get a DP dump write down the values and report here.

I'd love to do a datadumb, but for some reason the lamp doesn't want me to do this. (Yes it's disconnected from the Tuya app, no other devices are interacting with it, etc).

C:\Users\Feiko\Downloads\tuyadebug\tuyadebug>test.py 80157022e09806021245 192.168.0.60 b0282753461fa169
INFO:localtuya:localtuya version 1.0.0
INFO:localtuya:Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
INFO:localtuya:Using pytuya version '8.1.0'
INFO:localtuya:Detecting list of available DPS of device 80157022e09806021245 [192.168.0.60], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"80157022e09806021245","devId":"80157022e09806021245"}'
DEBUG:localtuya.pytuya:Failed to connect to 192.168.0.60. Raising Exception.
WARNING:localtuya.pytuya:Failed to get status: [WinError 10054] An existing connection was forcibly closed by the remote host
INFO:localtuya:Detecting list of available DPS of device 80157022e09806021245 [192.168.0.60], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"80157022e09806021245","devId":"80157022e09806021245"}'
DEBUG:localtuya.pytuya:Failed to connect to 192.168.0.60. Raising Exception.
WARNING:localtuya.pytuya:Failed to get status: [WinError 10054] An existing connection was forcibly closed by the remote host
INFO:localtuya:Detecting list of available DPS of device 80157022e09806021245 [192.168.0.60], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"80157022e09806021245","devId":"80157022e09806021245"}'
DEBUG:localtuya.pytuya:Failed to connect to 192.168.0.60. Raising Exception.
WARNING:localtuya.pytuya:Failed to get status: [WinError 10054] An existing connection was forcibly closed by the remote host
INFO:localtuya:TIMEOUT: No response from device 80157022e09806021245 [192.168.0.60] after 2 attempts.

@FeikoJoosten
Copy link

FeikoJoosten commented Nov 23, 2020

@ultratoto14 Okay, I managed to do a DP of the Tuya device. Here are the DPs

Max:

Device 80157022e09806020421 at 192.168.0.129 key f82e00d819d54955 protocol 3.3 dev_type type_0a:
    DPS [1] VALUE [True]
    DPS [2] VALUE [white]
    DPS [3] VALUE [255]
    DPS [4] VALUE [255]
    DPS [5] VALUE [0040ff00e1ffff]
    DPS [6] VALUE [bd76000168ffff]
    DPS [7] VALUE [ffff500100ff00]
    DPS [8] VALUE [ffff8003ff000000ff000000ff000000000000000000]
    DPS [9] VALUE [ffff5001ff0000]
    DPS [10] VALUE [ffff0505ff000000ff00ffff00ff00ff0000ff000000]

Min:

Device 80157022e09806020421 at 192.168.0.129 key f82e00d819d54955 protocol 3.3 dev_type type_0a:
    DPS [1] VALUE [True]
    DPS [2] VALUE [white]
    DPS [3] VALUE [25]
    DPS [4] VALUE [0]
    DPS [5] VALUE [ff00130163ffff]
    DPS [6] VALUE [bd76000168ffff]
    DPS [7] VALUE [ffff500100ff00]
    DPS [8] VALUE [ffff8003ff000000ff000000ff000000000000000000]
    DPS [9] VALUE [ffff5001ff0000]
    DPS [10] VALUE [ffff0505ff000000ff00ffff00ff00ff0000ff000000]

@ultratoto14
Copy link
Collaborator

@FeikoJoosten Sorry to bother you, the two dumps are exactly the same, something went wrong.

@FeikoJoosten
Copy link

@ultratoto14 Whoops my bad. That was a copy paste mistake haha. Anyway, I've fixed the original post.

I'd also like to point out that the info in TuyaCloud is pretty convenient as well as it gives a bit more context what each value stands for.
image

@FeikoJoosten
Copy link

Also figured out that I had a min brightness value assigned of 0. Changing it to 25 does increase the min brightness level. However, it's now clear that assigning white using the color wheel in HomeAssistant makes the lamp go purple instead of blue ish.

@ultratoto14
Copy link
Collaborator

@FeikoJoosten Ahhh, its clearer now 😄. On the tuya devices the white and colors are separated. When you use the color picker to change to white, it still use the color leds to display your choice, it explains why you have this behavior. To switch to white, try to change the color_temp slider instead.

@FeikoJoosten
Copy link

@ultratoto14 that does seem to make sense, but I'd say this is a bug then though. As the regular Tuya integration does support this properly. The lamp switches to white mode whenever I select the white color 😉

@ultratoto14
Copy link
Collaborator

@FeikoJoosten can you check the PR #182 ?

@buzurk26
Copy link
Author

how do you get the DPs, I got some mirabella genio bulbs https://www.kmart.com.au/product/mirabella-genio-smart-home-wi-fi-dimmable-5w-led-light/3188305, i got them into localtuya, i can get power on/off but thats about it

@FeikoJoosten
Copy link

@ultratoto14 What exactly do you want me to check? 😅 The code or the functionality?

@buzurk26 I added the lamp using Tuya/Smart Life and then followed the instructions from HOWTO get a DPs dump. Be sure to close the Tuya/Smart Life app as it can interfere with the connection. The LocalTuya approach never worked for me.

@ultratoto14
Copy link
Collaborator

@FeikoJoosten the functionality as it should be a fix to your issue 😄 (but to do so you need to test the code on your install)

@ThomasCr
Copy link

ThomasCr commented Dec 13, 2021

@FeikoJoosten how you got the info from your screenshot of the cloud?

Maybe it would help to figure out, how we can find a better way to set our devices.

I put my idea at #659

@FeikoJoosten
Copy link

@ThomasCr loging to iot.tuya.com. On the side --> Cloud --> Development --> Ensure the correct data center (top right) --> click on the devices tab --> select a list of your devices under the all devices catergory. --> Hit Debug Device

@evlo
Copy link

evlo commented Jul 5, 2022

[WinError 10054] An existing connection was forcibly closed by the remote host

@FeikoJoosten How did you get DPs after that error?

I'm stuck on that error for the device that does not have function set in tuya cloud
image

@FeikoJoosten
Copy link

Sorry, it’s been way over a year since I’ve looked at that. I don’t recall on how you should do this.

@evlo
Copy link

evlo commented Jul 5, 2022

as for the error message - tuya app on phone and other means of connecting to the device can't be used at the same time

as for the missing instruction set in iot.tuya.com - no idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants