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

RGB Control #16

Closed
J4YRY4N opened this issue Oct 26, 2018 · 13 comments
Closed

RGB Control #16

J4YRY4N opened this issue Oct 26, 2018 · 13 comments
Labels
enhancement New feature or request

Comments

@J4YRY4N
Copy link

J4YRY4N commented Oct 26, 2018

I have installed a tuya light, and have it under the devices section in the config, but I am not getting any options for colour or brightness in the Home app.
Great work overall though, I have used this for a power plug switch and a light successfully.

@codetheweb
Copy link
Collaborator

This package does not currently support color and brightness controls for bulbs, mainly because I don't have any. I'll welcome any PRs that add support for them though.

@Fabinewchurch
Copy link

I have the same issue with my rgb led light bulb.
Would be very happy to see this feature added.
Great plugin though. Works perfectly with my dimmer.

@codetheweb
Copy link
Collaborator

Brightness controls have now been added, check out the new README for instructions.

If you can provide the output of the below script I'll look into adding support for RGB bulbs. Run it a few times changing only the color between runs so we can see what parameter controls it.

const TuyAPI = require('tuyapi');

const device = new TuyAPI({
  id: 'xxxxxxxxxxxxxxxxxxxx',
  key: 'xxxxxxxxxxxxxxxx',
  ip: 'xxx.xxx.xxx.xxx'});

device.get({schema: true}).then(data => {
  console.log(data);
});

@Fabinewchurch
Copy link

Thanks for the quick answer.
This might be a silly question, but where exactly am I supposed to paste the script to get the parameters?

@codetheweb
Copy link
Collaborator

@Fabinewchurch just paste it into a file on your desktop or wherever is convenient. You'll have to run npm install tuyapi -g before you can run it with node <filename>.js.

@Fabinewchurch
Copy link

@codetheweb sorry for the late answer; I tried what you said, but I cant get the script to run; I always get an error saying: "Cannot find module 'tuyapi'" but I already installed it.

@VannaDii
Copy link
Contributor

VannaDii commented Nov 10, 2018

You’ll likely need to

sudo npm install -g tuyapi

node file_name.js

If that doesn’t work, can you post your console session of the attempt please?

@albertsal
Copy link

albertsal commented Nov 14, 2018

hi, I put some schemes to manage the colors (I noticed that you can also manage the scenes but at the moment I write only the colors)

the parameter concerned is 5
the first 6 digits are the color HEX "190b00" the next 4 I have not identified them but it seems to always be color "001a" maybe some shades the next 2 are for plain / bright min 19 max ff "ff" the last two to manage dark / bright min 19 max ff "19"

`####### color yellow#####
{ devId: 'xxxx',
dps:
{ '1': true,
'2': 'colour',
'3': 135,
'4': 255,
'5': '190b00001aff19',
'6': 'cf38000168ffff',
'7': 'ffff500100ff00',
'8': 'ffff8006ff000000ff000000ffff0000ff0000ff0000',
'9': 'ffff5001ff0000',
'10': 'ffff0505ff000000ff00ffff00ff00ff0000ff000000' } }

########color blue######
{ devId: 'xxx',
dps:
{ '1': true,
'2': 'colour',
'3': 135,
'4': 255,
'5': '00001900efff19',
'6': 'cf38000168ffff',
'7': 'ffff500100ff00',
'8': 'ffff8006ff000000ff000000ffff0000ff0000ff0000',
'9': 'ffff5001ff0000',
'10': 'ffff0505ff000000ff00ffff00ff00ff0000ff000000' } }

#######color green####
{ devId: 'xxx',
dps:
{ '1': true,
'2': 'colour',
'3': 135,
'4': 255,
'5': '00190a0091ff19',
'6': 'cf38000168ffff',
'7': 'ffff500100ff00',
'8': 'ffff8006ff000000ff000000ffff0000ff0000ff0000',
'9': 'ffff5001ff0000',
'10': 'ffff0505ff000000ff00ffff00ff00ff0000ff000000' } }`

---------- update ----------
I think I understand that the digits 7-8 and 9-10 are the coordinates to set the color values in the app the digit 11-12 set plain / bright and 13-14 dark / bright.if you do not want to use the app you can set all to 0

if you set parameter 2 to "white", also set parameter 3 for brightness and 4 for white temperature

senza nome

@codetheweb
Copy link
Collaborator

Mentioning @kalety so they can follow this issue for updates.

@ everyone who's still trying to control RGB bulbs: until such control is implemented in homebridge-tuya, you may want to look into using a different plugin like this one that supports RGB bulbs out of the box.

@codetheweb codetheweb added the enhancement New feature or request label Nov 26, 2018
@codetheweb codetheweb changed the title No colour/color or brightness control on lights RGB Control Nov 26, 2018
@zysoft
Copy link

zysoft commented Dec 10, 2018

@albertsal thank you for your input! I came across the same challenge with lightbulbs and your research helped a lot. I just submitted a pull request with lightbulb accessory support. It supports dimming, color temperature, and custom rgb color. You could give it a try if you want, I would appreciate your feedback!

@albertsal
Copy link

@zysoft hello I'm glad that I helped, I did not initially know what was homebridge, after I realized that it is an apple app, I still wanted to participate writing what I discovered. I unfortunately do not have apple products to give you feedback

@codetheweb
Copy link
Collaborator

(I'm copy/pasting this into every open issue and PR.)

This plugin is now deprecated, as I don't have enough time to maintain it along with other TuyAPI related projects. Please use AMoo-Miki's homebridge-tuya-lan plugin instead. (Or, you can continue to use this plugin, but I will not be giving support or adding any new devices.)

I'm sorry about this, but this plugin is taking a disproportionate amount of my time that I believe is better spent making TuyAPI more stable and adding more tools to the ecosystem.

@iRayanKhan
Copy link
Owner

iRayanKhan commented Apr 3, 2020

Closing; inactive thread. If you need support please re-open this issue.

This plugin now supports RGB/RGBW lights.

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

7 participants