-
Notifications
You must be signed in to change notification settings - Fork 7
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
Json format for lightstrips #14
Comments
Hi there. |
I think you've got a mistake here ... you need to set hsv instead of hue The correct json should be like { Power: "on", |
thank you |
Check and come back with results👍🏻 |
Hello there. |
I am having this same issue now as well with both custom and separate HSV commands. This is my msg.payload: I have tested on/off, color temp, and brightness and they all work (only tested custom with those, but I can try individually if you think that will help). HSV is the only one not working (neither custom nor individual).
I was looking through the code, and did not see anything related to my device directly (strip2), but the color3.js file appears to be the same capability. Is this a bug in the setter for HSV?
Notice the difference between setColorHSV and the other setters (no return statement and _miioCall vs just miioCall). Again, I am not even sure if this is relevant to the issue at hand, but it is something I noticed when perusing around. Where are the functions for getting and setting the values for yeelink.light.strip2? Are they baked into some imported library or package or does it just use the yeelink.light.color3.js file? P.S. There is also a typo in the DEVICES.md that might be a source of confusion going forward even if this issue gets resolved: yeelink.light.strip1, yeelink.light.strip2, and yeelink.light.color3 have a typo in the Values for Commands column, where saturation is misspelled as satuartion. |
unfortunately not |
@Cjkeenan thanks for your research First of all, it doesn't matter how to test HSV (separate command or complex JSON).The result would be the same. I've checked syntax for set "set_hsv" command in spec-paper at www.yeelight.com. Everything seems to be done correctly. Please see page 12 of this file: Yeelight_Inter-Operation_Spec.pdf Thus, I think that your suggestion to change "_miioCall" to "miioCall" in setColorHSV(v) setter could be the cure for the whole issue. What I propose: make that change in your local yeelink.light.color3.js file, reboot NR and test HSV command once again. If everything works correctly, I'll update yeelink.light.color3.js file in the next 0.5.13cversion + merge your PR about typos in devices.md. Regards |
No luck unfortunately, this is the location of the file I would have to modify right? Also does any recompilation need to happen or is a reboot of NR sufficient? Does the yeelink.light.strip2 device reference the yeelink.light.color3.js file or does it use something else? It looks like the same "issue" is here so I am thinking it really is not an issue: Also found this: Do you know if that underlying node module is still being maintained? I think I may just switch to using this since everything is working out of the box even if these nodes have not been updated in a while and only apply to yeelight lights versus the variety of devices your nodes support. |
Yes, this is it
No, NR reboot after making changes is enough
These are separate defFiles: yeelink.light.color3.js is for Mi LED Smart Bulb and yeelink.light.strip2 is for Strips (strip 2, 6 and 8), that supports HSV. Please refer to devices.md to see which defFile is for which device.
I saw that issue from @Pittini... Well, node-mihome hasn't been updated for quite a while, but main functionality (establishing connection and polling the device) works good. All the rest is about making correct defFile for certain device according with Xiaomi specs and testing.
Yes, these nodes are good alternative for Yeelights, but it will be appreciated if we could make some more tests with my nodes to make setting colour finally work. I think the solution is not far. So, let's try following options: 1) according to Yeelight specs Yeelight_Inter-Operation_Spec.pdf let's push full json to set_hsv function.Here you need to: setColorHSV(v) {
this.miioCall('set_hsv', withLightEffect([v.hue, v.saturation, v.effect, v.duration]));
} b) reboot NR ...if it doesn't work => option 2 2) getting rid of "withLightEffect":a) change defFile like that: setColorHSV(v) {
this.miioCall('set_hsv', [v.hue, v.saturation]);
} b) reboot NR ...if it doesn't work => option 3 3) getting rid of "withLightEffect" + full JSON:a) change defFile like that: setColorHSV(v) {
this.miioCall('set_hsv', [v.hue, v.saturation, v.effect, v.duration]);
} b) reboot NR ...if it doesn't work => option 4 4) migrating from set_hsv to set_rgb:a) change defFile like that: setColorHSV(v) {
this.miioCall('set_rgb', [v.rgb, v.effect, v.duration]);
} b) reboot NR I hope, at least one of these options could work. :) Regards |
@Cjkeenan , hello again. The main thing here: you should make and test changes in defFile NOT at the source directory, but at the target directory (the directory of node-mihome lib). Please, test changes again there and come back with the results 👍🏻 |
@Cjkeenan hello. |
@stason325 I had the same problem. I first thought I calculated HSV wrong, but it seemed to me that "ColorHSV" just didn't get sent to the setColorHSV function(after some console logs). it's because of the eval function.(took me a while to find how setPower etc. were executed XD). so problem one I solved by making it: this way the data won't get changed. problem two. as you and Cjkeenan both already noticed solves the color problem |
Hello,
I am sorry to bother you with such a small detail but I cannot get the HSV part of my lightstrip working. Power and brightness are working when I choose "custom json" in my MIIOSendCommand but I cannot have the Color HUE part.
I followed the instructions given there though : https://github.com/stason325/node-red-contrib-miio-localdevices/blob/master/DEVICES.md
but it is just not working whatever are the values I put after "hue" and "saturation".
Here si the Jsin I send as my payload :
{
"Power": "on",
"Brightness": 100,
"Color_Temp": 4000,
"Color_HUE": {
"hue": 100,
"saturation": 200
}
}
thank you
The text was updated successfully, but these errors were encountered: