Author Topic: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)  (Read 12589 times)

Offline Juppers

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +2/-1
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #15 on: June 22, 2017, 11:24:22 am »
Looks like the latest version of UI7 breaks this plugin, at least it stopped working for me. It looks like everything works except turning the devices on. That one is sort of important.
« Last Edit: June 22, 2017, 12:01:30 pm by Juppers »

Offline supsen

  • Sr. Newbie
  • *
  • Posts: 20
  • Karma: +1/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #16 on: June 23, 2017, 02:48:07 pm »
Looks like the latest version of UI7 breaks this plugin, at least it stopped working for me. It looks like everything works except turning the devices on. That one is sort of important.

@Juppers I have noticed the same exact problem. The previous Beta didn't work for me either, so I had to downgrade Vera to 7.19 in order to get my MagicHome LEDs to work again.

Offline Juppers

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +2/-1
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #17 on: June 25, 2017, 08:12:18 pm »
I turned on debug and it looks like the plugin is sending dim commands instead of switchpower commands for on, but sends the correct command for off. The new version probably has some restrictions on device types causing the issue, but I don't knwo the plugin format well enough to know for sure.


50      06/25/17 20:04:52.416   luup_log:98: MagicHomeRGBW: DIMMING 0,128,128,0 to 100 <0x77f54320>
50      06/25/17 20:04:52.417   luup_log:98: MagicHomeRGBW: Dim calculations 1 <0x77f54320>
50      06/25/17 20:04:52.417   luup_log:98: MagicHomeRGBW: SLLT: RGBW_SET STATUS: 0,128,128,0 TARGET DIM: 100 TARGET RGBW: 0,128,128,0 <0x77f54320>

50      06/25/17 20:08:30.505   luup_log:98: MagicHomeRGBW: SWITCH STATUS CHANGE: GIVEN: 0 <0x77f54320>
50      06/25/17 20:08:30.506   luup_log:98: MagicHomeRGBW: Powering off! <0x77f54320>

Offline ceefin

  • Full Member
  • ***
  • Posts: 134
  • Karma: +6/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #18 on: June 26, 2017, 01:46:50 pm »
I haven't upgraded, so I haven't run into this problem yet. I apologize that I haven't fixed it as well.

It's been about 16 months since I published the plugin. I'm sure some things have changed. For some reason I remember something about 'on' resulting in a dim setting of 100% (since that's full ON). It worked this way previously (since it makes sense to me that anything dimmed > 0% is inherently 'on'). If I need to throw a line in there for a SwitchPower call, that's a pretty easy fix.

How are you controlling the bulbs? Are you using LUUP calls, or interacting with the device via the GUI/scenes?

Also, I'm in the process of packing & moving, so I will be unable to commit any significant time to the plugin at this time, but I'll try.

Here's how I control my outside garage lights using LUUP.

Code: [Select]
-- 181 is left light, 183 is right light
luup.call_action("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1","SetRGBW", { newRGBW = "0,0,0,255"}, 181)
luup.call_action("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1","SetRGBW", { newRGBW = "0,0,0,255"}, 183)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue=1},181)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue=1},183)

I think my intent in setting things up as they are, was so that the preferred color/dim levels could be set before sending the SwitchPower1 command.

I don't do any interaction with these devices via scenes aside from running the luup code to make it to exactly what I need it to do.

Again, my apologies for the new version hiccup. I'm grateful that you guys are using the plugin and that you've gotten some enjoyment from my work. We'll get it sorted out.
« Last Edit: June 26, 2017, 02:04:07 pm by ceefin »

Offline Juppers

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +2/-1
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #19 on: June 26, 2017, 03:09:12 pm »
I typically interact with them with scenes and GUI/App. Mine are used as accent lighting for evenings, so they are typically turned on close to dark and go off a bit later. I'll try LUUP calls to see if they will turn on with those.

Offline Juppers

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +2/-1
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #20 on: June 26, 2017, 08:19:21 pm »
No joy on the luup call. For the time being I'm using homekit to turn them on and letting vera handle the changes and turning off.

Offline jasonatepaint

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #21 on: June 27, 2017, 10:16:32 pm »
Here is my fix...  As previously mentioned, the firmware update seems to cause "SetTarget" (Setting to value=1) to call "SetLoadLevelTarget". My change looks at the current "Status" variable and if the lights aren't already powered on (Status=1), it calls the powerUnitOn() function to actually turn the unit on.

1. Download I_MagicHomeRGBW.xml and search for the following code  (approx line 767)

Code: [Select]
<action>
      <serviceId>urn:upnp-org:serviceId:Dimming1</serviceId>
      <name>SetLoadLevelTarget</name>

2. Scroll down to this conditional block:
Code: [Select]
if newLevel == 0 then
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", 0, lul_device)
luup.variable_set("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1", "IconState", 0, lul_device)
else
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", 1, lul_device)
luup.variable_set("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1", "IconState", newLevel, lul_device)
end

3. You will change it to this:

Code: [Select]
if newLevel == 0 then
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", 0, lul_device)
luup.variable_set("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1", "IconState", 0, lul_device)
else
if (luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", lul_device) == "0") then
if(DEBUG_RGBW) then luup.log("MagicHomeRGBW: Powering on!") end
powerUnitOn()
end
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", 1, lul_device)
luup.variable_set("urn:ceefin-mcvforum-com:serviceId:MagicHomeRGBW1", "IconState", newLevel, lul_device)
end

4. Upload the file. Once the luup engine restarts, your lights will power on as expected.


Note: If your devices are turned "on" in Vera (but aren't actually on), you will need to turn them off (so the variable 'Status' = 0) otherwise the command will be ignored.

Hope this helps anyone else until a fix is issued officially.
« Last Edit: June 28, 2017, 12:29:04 am by jasonatepaint »

Offline sagielka

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #22 on: June 28, 2017, 06:39:44 am »
Thanks! works great.

Offline ceefin

  • Full Member
  • ***
  • Posts: 134
  • Karma: +6/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #23 on: June 28, 2017, 08:46:15 am »
jasonatepaint: Seriously, I appreciate your help on this. I'll incorporate this change and republish ASAP.

Offline jasonatepaint

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #24 on: June 28, 2017, 06:16:07 pm »
jasonatepaint: Seriously, I appreciate your help on this. I'll incorporate this change and republish ASAP.

No problem. I appreciate all your work to build it.    :)

Offline Juppers

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +2/-1
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #25 on: June 28, 2017, 06:20:07 pm »
Awesome. Thanks for all your help everyone! I'm back in business.

Offline ceefin

  • Full Member
  • ***
  • Posts: 134
  • Karma: +6/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #26 on: July 09, 2017, 10:29:51 am »
I have added the updated code chunk to the xml file and published a new release (1.3). I'm relying on reports from you guys saying this works, as my HA stuff is still mostly in a box after our recent move. I'm eventually going to get around to getting everything back up and running here. Please let me know if this release breaks anything!

Thanks again for your help!

Offline thistle2015

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #27 on: July 22, 2017, 07:34:28 pm »
Hi does anyone know when the new release 1.3 will be out?

Offline ceefin

  • Full Member
  • ***
  • Posts: 134
  • Karma: +6/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #28 on: July 23, 2017, 04:20:42 pm »
I submitted it 2 weeks ago. I sent the support folks an email today to see what's going on.

Just out of curiosity, those of you who are following this thread - what units are you using the plugin with?

At the moment I'm only using my Magic UFO RGBW LED controller for above my kitchen cabinets. I have 5 other light bulbs that are still in the box I used to move them in. Eventually I'll find new uses for them in the house. Two of them were in my garage lights outdoors but in my new house all of those are candelabra-sized so I can't use them.

I've seen a newer, cheaper unit in the Nexlux/Superlight brands that use the app - anyone using those?

Offline thistle2015

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: PLUGIN: Magic Home Wifi LED Control (Bulbs & RGBW strips)
« Reply #29 on: July 29, 2017, 10:21:36 am »
Does anyone have the file I could copy?

I use it to control my RGBW tape