steve228uk / homebridge-magichome

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

Can only turn on and off in Homekit #36

Open Captain-Greybeard opened 6 years ago

Captain-Greybeard commented 6 years ago

Hi, I found Steve228uk's tutorial on how to control a cheap LED-strip in Homekit and thought that looks easy... I followed the tutorials on how to install Homebridge and MagicHome on my Raspberry Pi 3. And I got so far as adding Homebridge in Homekit.

My problem is that I can only turn the light on and off in Homekit, I can't change colors or dim. basically the same problem as in this thread: https://github.com/steve228uk/homebridge-magichome/issues/21

I bought one of these on eBay: https://www.amazon.co.uk/BRIGHTINWD-Waterproof-Adapter-Controller-Control/dp/B01KURKY1M/ref=as_li_ss_tl?s=lighting&ie=UTF8&qid=1477334331&sr=1-1-spons&keywords=wifi+led+controller&psc=1&linkCode=sl1&tag=stephradfo-21&linkId=73e8ae2f3e8346608b97715874f1571f

The controller turned out that the controller is GRB and my LED-strip is RGB, could that be the issue? Also in the MagicHome app the colors green and blue are swapped so maybe the controller is RBG.

Thanks in advance

Zacknetic commented 6 years ago

Paste your config file

Captain-Greybeard commented 6 years ago

I'm a real newbie when it comes to Linux and stuff like this so don't laugh too hard at the config file :)

{ "bridge": { "name": "Homebridge", "username": "BB:39:3D:F3:CE:31", "port": 51827, "pin": "015-60-283" },

    "description": "An example Homebridge config for MagicHome.",

    "accessories": [{
            "accessory": "MagicHome",
            "name": "Trappan",
            "ip": "192.168.1.130",
            "setup": "RGB",
            "purewhite": false
    }]

}

Captain-Greybeard commented 6 years ago

It was "RGBWW at first but I had the same problem.

Zacknetic commented 6 years ago

I think I see the issue. Driving home now to look at my own config.

On Feb 12, 2018, at 10:54 AM, Captain-Greybeard notifications@github.com wrote:

It was "RGBWW at first but I had the same problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Zacknetic commented 6 years ago

There shouldn't be a problem if that's your only part in your setup. That config looks fine.

As for the GRB issue, did your controller come with a remote? If so, the colors can be fixed by running a one time fix using the remote.

Confirm that homebridge is running from THAT particular config.json. If you are running homebridg as a service, it will use a config.json from a different location. Don't worry, setting it us as a service is another step so if you dont know what I'm talking about, chances are that it's irrelevant.

Captain-Greybeard commented 6 years ago

The config.json file is located in the homebridge folder. accessories config.json persist (when I run ls)

I just followed this guide: https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi and start homebridge manually on my Raspberry (it runs Rasbian Stretch if that matters)

The controller did come with a remote, I'll see if I can find how to fix the GRB issue.

Thanks for taking the time :)

Zacknetic commented 6 years ago

It's something like

turn the lights off with the power button on the controller while holding the red button press the power button keep doing this until the colors work correctly

Captain-Greybeard commented 6 years ago

I found it :)

Anything else on the other problem?

Captain-Greybeard commented 6 years ago

I think I solved it, I went back to guides on Homebridge-Magichome and saw that you could use "RGBW" and that worked. I can dim and change colors now, I'll have to test it more tomorrow but I think that did the trick.

Thanks alot for help :)

Captain-Greybeard commented 6 years ago

It works now, I couldn't change the colors on the controller. I found something on Google but that and your tip didn't work. I'll just rewire the cable from the controller.

Zacknetic commented 6 years ago

Or, instead you could use my iteration of flux_led.py which allows for GRB configurations. Bit it would require replacing 2 files.

Captain-Greybeard commented 6 years ago

Ok is there a guide I could use? Like a said, I'm a real newbie when it comes to Linux and such.

Zacknetic commented 6 years ago

I will write you one later today. For now, don’t snip those wires.

Captain-Greybeard commented 6 years ago

Hi, have you gotten around to write that guide?

toshibochan commented 6 years ago

If the controller is RBG: Setup to RGBW and purewhite to false

If the controller is RGBW Setup to RGBW and purewhite to true