-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Reset Bulb to white #7
Comments
Maybe you can set the different values to the "white" numbers? I'm not sure, but it could be:
|
Hey mate, 0,0,255 gives a kind of sickly blue! Do you have any code that will query the HSB settings of a bulb? Then I can set it to the default warm white from the app, and query the settings to clone them into my script? Thanks, Ian |
You may want to change down the brightness. Check this HSB Color Picker https://codepen.io/HunorMarton/details/eWvewo? Maybe by using |
I'm looking at the JSON object returned. If I've been tampering with the HSB values in the app, the bulb returns ; stdClass Object
(
[data] => stdClass Object
(
[brightness] => 255
[color_mode] => colour
[online] => 1
[state] => true
)
[name] => Kitchen Ceiling
[icon] => https://images.tuyaeu.com/smart/icon/1467167733_0.png
[id] => 7577######
[dev_type] => light
[ha_type] => light
) but if I set it to standard White in the app, then scan it, it returns this ; stdClass Object
(
[data] => stdClass Object
(
[brightness] => 255
[color_mode] => white
[online] => 1
[state] => false
)
[name] => Kitchen Ceiling
[icon] => https://images.tuyaeu.com/smart/icon/1467167733_0.png
[id] => 7577######
[dev_type] => light
[ha_type] => light
) So, the [color_mode] is changed, but tuyacloud-php doesn't handle that object. I think it needs a trap somewhere around line 155 to detect a call for color_mode being set to the default white to switch it back from the HSB color mode? Any thoughts? Ian |
OK, good to know. In the Python code, there are some stuff related to it. I'll need to have a look. |
Ok, I'll keep playing, and if I solve it I'll chuck you a patch proposal, but I'm rubbish at hacking other peoples work! |
I'm not sure it's possible to change from color to white with the API. Maybe look at these two comments to see if it helps:
If yes, let me know. |
I'll keep experimenting, no success so far. It's just about changing the mode, and pushing back to the api 'color_mode'. |
I think we need to alter this? ; function setState($options) { From onOff to mode, and add an option, perhaps we need it to be 'off', 'color' or 'white'? Off is obvious and remains as is, On should go, 'color' should call the HSB value as was stored on the server, and 'white' should kick it to the standard white state? |
Based on the conversations I told you to read, I don't think it's possible... |
I'm working on it... (It's raining and a bank holiday here in UK, in covid lockdown, it's the most interesting thing to do today!) |
Any progress? Did you try to play with
|
This issue has been automatically closed because the requestor didn't provide any additional comment. |
Hi again Aymkdn,
Sorry man, I'm just playing with colorSet, works great, thank you!
I wonder though, is there a quick shortcut to reset the bulb to standard white? In the Tuya app you can select all colors, as the api lets us, but you can also set the bulb back to a standard "white". Is there a quick way to do that in TuyaCloud? I think in the app it just disables the color LED's and uses the white ones only?
Thanks,
Ian
The text was updated successfully, but these errors were encountered: