steve228uk / homebridge-magichome

A Homebridge plugin for Magic Wifi devices
MIT License
82 stars 45 forks source link

Cant change color #34

Open e5uicide opened 6 years ago

e5uicide commented 6 years ago

Hey, I can't change the color via HomeKit on LED1,LED2 and LED3; LEDMiniController works fine. With the MagicHomeApp everything works great. i used BEILAI DC 12 V Mini WIFI LED RGB Controller as LEDMiniController and three DC12V 24 V Wifi LED-Controller as LED1,LED2 and LED3. All controllers are from AliExpress and the MagicHome integration works without problems. I'm using 4 Pin RGB Led Strips and tried the RGB and the RGBW Setup. The RGBW Setup works with LEDMiniController, but neither RGB nor RGBW with the others.

conifg.json:

{ "accessory": "MagicHome", "name": "LEDMiniController", "ip": "192.168.178.67", "setup": "RGB", "purewhite": false } , { "accessory": "MagicHome", "name": "LED1", "ip": "192.168.178.68", "setup": "RGB", "purewhite": false } , { "accessory": "MagicHome", "name": "LED2", "ip": "192.168.178.69", "setup": "RGB", "purewhite": false } , { "accessory": "MagicHome", "name": "LED3", "ip": "192.168.178.70", "setup": "RGB", "purewhite": false }

e5uicide commented 6 years ago

i test varios settings - these work fine:

{ "accessory" : "MagicHome", "purewhite" : false, "name" : "LED", "ip" : "192.168.xxx.x", "setup" : "RGBWW" }

for this one:

controller1 controller2

and

{ "accessory" : "MagicHome", "purewhite" : true, "name" : "LEDMiniController", "ip" : "192.168.178.67", "setup" : "RGBW" }

for this one:

mini

both Controllers are from AliExpress.

Kamonix commented 6 years ago

Same problem, I can't change the color or brightness via HomeKit. Only On/Off. With the Magic Home App it works.

Zacknetic commented 6 years ago

RGB controllers need RGB settings. RGBWW need RGBWW settings. Don’t mix and match.

Kamonix commented 6 years ago

I have the first controller, with an RGBW Strip and setup. It doesn't work:/

Zacknetic commented 6 years ago

First controller? Just explain your setup. Post a picture if possible.

Kamonix commented 6 years ago
35513207-99d72fe6-0502-11e8-8a2e-91bbe5596ccf

I have this controller with an RGB-WarmWhite Strip. The setup is set to RGBW (i testet RGW,RGBW with pure white true and false). Manually over beville/flux_led not work either. Only with Danielhiversen/flux_led. A combination between the homebridge plugin and Danielhiversen/flux_led would be nice. Sorry about my english:D

Zacknetic commented 6 years ago

This is an RGBWW controller. Set it up as such. It will not work with RGB or RGBW

Kamonix commented 6 years ago

I have reinstalled all. With the RGBWW and pruewhite: true setting i can change the color and brightness from the RGB LEDs, but the WarmWhite LEDs are always off

Zacknetic commented 6 years ago

Move the reticle to the whitemost center of the wheel.

Kamonix commented 6 years ago

The RGB LEDs turn to mixed white, the WW LEDs are off.

Zacknetic commented 6 years ago

Confirm that pure white is set to true. If that doesn’t work, try restarting the Pi and reinitializing the controller.

Kamonix commented 6 years ago

Didnt work:/ Purewhite is set to true and i reinstal the plugin

Zacknetic commented 6 years ago

try downloading and replacing your flux_led.py and index.js with my version.

Kamonix commented 6 years ago

now works nothing, no on/off, color, brightness

Zacknetic commented 6 years ago

Are you sure homebridge is running? Did you chmod flux_led.py so it’s executable?

Kamonix commented 6 years ago

Yes, i am sure and chmod this file

Kamonix commented 6 years ago

Now I have changed the flux_led.py and now it works half. WarmWhite works only with RGB White together. What i can change that only the WW-Leds turn on? And can I mix WW with for example Red?

` def setWarmWhite(self, level, persist=True): if persist: msg = bytearray([0x31]) else: msg = bytearray([0x41]) msg.append(0x00) msg.append(0x00) msg.append(0x00) msg.append(utils.percentToByte(level)) msg.append(0x00) msg.append(0x0f) msg.append(0x0f) self.__write(msg)

    def setRgb(self, r,g,b, persist=True, setup="RGBW"):
            if persist:
                    msg = bytearray([0x31])
            else:
                    msg = bytearray([0x41])
            msg.append(r)
            msg.append(g)
            msg.append(b)
            if setup == "RGBW":
                    msg.append(0x00)
                    msg.append(0xf0)
            if setup == "RGBWW":
                    msg.append(0x00)
                    msg.append(0x00)
                    msg.append(0xff)
            msg.append(0x0f)
            self.__write(msg)

`

Zacknetic commented 6 years ago

No, this is a limitation. What changes did you make?

Kamonix commented 6 years ago

I have add one more msg.append(0x00) to warmwhite and play a little bit with 0 / f in def setRGB

Now it works:) thank you for your help:)

Will it work in the future that ww mix with rgb?

Zacknetic commented 6 years ago

It looks like Steve added that functionality to his. I’d have to take a look at it.