philip1986 / pimatic-led-light

A template for creating plugins
http://pimatic.org/
GNU General Public License v2.0
7 stars 13 forks source link

Wifi370 no colors #27

Closed incmve closed 8 years ago

incmve commented 8 years ago

Hi guys,

I installed the plugin and I can switch on and off my Wifi370 LED's. I can't change the color or dim the LED's nothing happens, I tried with a rule

if button is pressed THEN turn Aqua LED on and after 5 seconds set Aqua LED to red

The LED's are switched on and in the colorpicker I see it changing to red but the LED's stay white. What am I doing wrong, can I supply log's or anything?

another user reported the same thing in my forum topic. http://forum.pimatic.org/topic/728/wifi370-color-picker-problems

philip1986 commented 8 years ago

I think this the same like https://github.com/philip1986/pimatic-led-light/issues/19. Or correct my if I am wrong!

incmve commented 8 years ago

Hey, there was no update available so I pulled the git. But it isn't working :( It's the same, on/off work but color changing isn't.

I have it working using scriptfiles made by @leader21 https://github.com/pimatic/pimatic/issues/348#issuecomment-68384242 He is using this "driver" https://github.com/secesh/node-rgb

leader21 commented 8 years ago

my scripts are using another lib. I was first playing with the above mentioned but then I was switching over to this one here https://github.com/b4cedev/node-light-wifi370 just have a closer look at the threat mentioned by incmve

but @mwittig created a pull request to the led plugin that still hasn't been released to the master branch yet. This should solve the mentioned issues

have a look here http://forum.pimatic.org/topic/881/solved-error-message-with-installing-pimatic-led-light/5

philip1986 commented 8 years ago

The PR from @mwittig (https://github.com/philip1986/pimatic-led-light/pull/25) which address also the color issue is already merged to the master, but not published on npm. What I can say for sure its working for device IwyMaster. The device WIFI370 is using the same "driver" as IwyMaster, so there might be differences in the protocol between WIFI370 and IwyMaster.

mwittig commented 8 years ago

@incmve A new release of pimatic-led-light is available. Can you please give it try? If the problem with your Wifi370 remains it is most likely a problem with the underlying iwy-master package. Please also let me know if you know an alternative node package which works with your Wifi370. I am happy to look into this - either retrofit changes into iwy-master or create an additional device implementation using the alternative driver.

incmve commented 8 years ago

I am updating now and going to test.

Leader21 used https://github.com/b4cedev/node-light-wifi370 with some scripts and that worked perfect for switching on/off and switching pre-defined colors. https://github.com/pimatic/pimatic/issues/348#issuecomment-68418652

Here is another but I havent tested it https://github.com/firsttris/node-red-contrib-wifi370

mwittig commented 8 years ago

I had a brief look at node-light-wifi370. As far as I can see it is using the same command sequences for color&brightness as iwy-master.

incmve commented 8 years ago

I hooked up the wifi370 but it won't connect to my wifi sigh

thymian commented 8 years ago

hey, i got 3 Wifi370 devices in my apartment but i cant switch the colors. The thing is i am pretty sure that i was able to switch colors some versions ago. Cant exactly say when it broke, but would be pretty happy if this could be solved.

I can provide the infos whatever you want. If needed I could also borrow some (german) developer one of my controllers via mail to get it working again.

Currently only on/off switching works and i can switch colors with predefined scripts (this really sucks) and https://github.com/b4cedev/node-light-wifi370 (which incmve already linked)

mwittig commented 8 years ago

@thymian Thanks for the feedback. Did you also try with the latest version of the plugin published 3 days ago?

thymian commented 8 years ago

yes, i followed your guide http://forum.pimatic.org/topic/1114/updated-how-to-install-a-plugin-from-github/1 to remove the plugin completely and then reinstalled it. Sadly it doesnt work :(

mwittig commented 8 years ago

Gosh. I think I know what it is. Try to add the following to your device config:

"device": "wifi370"

For example:

{
      "id": "led-1",
      "name": "LED",
      "class": "Wifi370",
      "device": "wifi370",
      "addr": "102.168.0.77"
    }
thymian commented 8 years ago

i ran out of time, thanks for your answer, i will test this tomorrow.

One more thing: pimatic-led-light is producing lots of errors for me: error [pimatic-led-light]: [Error: write after end] and error [pimatic-led-light]: [Error: connection timeout]

But maybe your change will fix this, too?! I keep you updated tomorrow.

philip1986 commented 8 years ago

@thymian where did you buy your controllers? I have also one (bought at Ebay), but unfortunately its using a whole different protocol.

thymian commented 8 years ago

@mwittig You are awesome! When i added <"device":"wifi370"> everything works fine again! Thanks for your help and thanks a lot for your nice plugin!

@philip1986 i bought all my controllers on amazon (germany) for about 25€. If you are still searching the right ones or want to know more about your problem i think this issue is interesting for you: https://github.com/pimatic/pimatic/issues/348 Furthermore there is also a thread in the pimatic forum: http://forum.pimatic.org/topic/1027/where-to-buy-wifi370

mwittig commented 8 years ago

@thymian Thanks. It's great it is working now. Meanwhile I have published a new new release and the device property is no longer required. Can please give it try occasionally just to double-check this is also working as expected? This would be great!

thymian commented 8 years ago

@mwittig Yeah i saw your changes in the code and thought that adding device might be obsolete now. Just tried it and color changing works again with all controllers.

But there are some things which are kind of ugly i want to inform you about (but i don't really care because it is working) 1) the two errors i mentioned above occur regulary (but they arent really errors, because everything is working) 2) if i hold down the mouse on the color wheel, the pimatic GUI is kind of blinking because of the "loading"-window. I cant really describe it so i made a video. 3) if i press the white X on the color wheel (which i dont really know what its for because one can switch it of with the switch on the right) pimatic produces a long error which you can also see in the video

https://youtu.be/Agt1bTkHmhw

Didn't know if i have to open another issue. Sorry for that

mwittig commented 8 years ago

@thymian Thanks for the video which demonstrates issue 2) and 3) very well. I haven't experienced issue 2) so far, btw. Which browser are you using? I'll have a look at these issues as soon as I can.

The "white X" is to change to white mode which which is supported with some of the LED controllers which provide four channels R-G-B-W. For Wifi370 it may be emulated by setting the approprate RGB value, but most likely the light won't be white really. If you have thought about this please let me know.

mwittig commented 8 years ago

@thymian Minor update:

Regarding 1) I have no news yet. I am not able to reproduce it yet.

I am able to reproduce 2) now. I am not sure whether this is to due recent changes in pimatic-led-light or it is due to some subtle changes in modible frontend code. I'll investigate this further as soon as I can.

Regarding 3) I have written a mockup server to see the byte sequences sent to the Wifi370. As far as I can see the byte sequences sent are OK, but may be it is the response from Wifi370 causing the error. Can you please send me there error message with the full statck trace? Thanks.

philip1986 commented 8 years ago

Regarding 1) the issue is caused by pushing to many commands via the socket. I thing it could be solved by either refactoring the "driver" or change the UI behavior and lower the calls to the light device

Regarding 3) By just looking into the error message, it lseeams like the issue is driver by pimatic-hap

@thymian thx for the advice, I will try to buy the right one

thymian commented 8 years ago

I dont think it is a browser issue, because chrome and safari both behave the same.

Regarding 3 (long error message): So you say pressing the X on the upper right corner sets the R,G,B LEDs to 0% and the W LEDs to 100% (with an RGBW Stripe and Controller)? I have to think about a good way to use it as wifi370 user. Option 1: Make it invisible for RGB Controllers Option 2: One can set an RGB value (in the config) to emulate warm white. For my controller this would be sth. like R255 G255 B70

Regarding 1 (Blinking GUI): I really like the ability to slide around the color wheel and see the colors changing live. Lowering the calls to the light device would lead to a worse user experience.

As we already went full off-topic: :bulb: As i said before, your plugin is great. There are two things which i think would lead to an nicer user experience: a) If one switches the LEDs on, the lights should dim up in like one or two seconds. b) I am missing something like a morning light. People pay 200€ for these bulbs which dim up in about 30 min to emulate the sun rising. I once wrote a script myself but this was very bad written because i dont understand that promis programming and didnt find out how use for or while :sunglasses:

mwittig commented 8 years ago

I am closing this ticket now. Please use the new issue tickets for further correspondence. Regarding the feature requests see http://forum.pimatic.org/topic/1176/dim-up-option-for-pimatic-led-light and http://forum.pimatic.org/topic/1175/morning-light-simulate-sunrise-as-part-of-pimatic-led-light