[Release] Magic Home Wifi Devices - 0.86


#21

I still haven’t gotten home, yet. I’ll edit the github code for the RGBW Bulb to be the working version, but the RGBW Controller should work for you already—that one has been working this whole time :slight_smile:


#22

Oh ok cool. I've got to physically replace the controller but I'll report late tonight. Good excuse to gaurd my Halloween decorations on this naughty night. My neighbors will probably call the cops seeing me crawling around in the bushes at night.

Last time I did this a wasp came back in with me on my pant leg.


#23

If they call the cops you have my word that you’re just doing it in the name of science :joy: I’d say the same about your wasps, but I don’t think they care.

I just updated the bulb file, so either way, you’ll be set. Use the RGBW controller driver, and if that doesn’t work, let me know :slight_smile:


#24

Sad sad news. I forgot how I cut the cables of my power supply. I won't be able connect the controller tonight. It's a shame you didn't make this driver a month and a half ago lol.

The H801 is responding now though.
Some time after Halloween I'll have to figure out a way to get the power supply back to the stock controller and try it out.


#25

Ah, shoot!

By the time you get to the the controller, hopefully there are a lot of improvements :wink:


#26

Agreed!
I'll be away until the 9th.
Once I settle back into home I'll give it a shot.


#27

Holy crap, i was searching for this for so long! It's working perfectly, much better then using ifttt :smiley:


#28

I'm so glad it is working for you! Keep an eye out for updates :slight_smile:


#29

@keithcroshaw

I've been playing around with the updated version, and testing how fast I can get color changes to operate, while I work on it... I think you're really going to like how fast these devices respond! I've been editing 12 devices with different levels of WiFi connectivity, and they're all responding within 1/2s.

It's even faster than when I was on Home Assistant OR SmartThings.

I'm not sure what kind of wizardry the HE staff has done, but again, I can't vouch enough for them.


#30

I'm very excited to try it. Still half a country away until the weekend. :stuck_out_tongue_winking_eye:
I have to fix my power supply connector first... Yuck.


#31

I'm trying to use the LED strip with rooms app and im getting the following error:


#32

Interesting; thank you. I'll take a look into this.


#33

0.71 has been released. It will greatly improve performance, and keeps devices alive in Telnet.

The device now auto-polls itself every 150 seconds. If you need it to poll faster, a Rule should be able to take care of that. There's no real reason to poll right now aside from keeping the device connection alive, though.

You may need to reboot your hub after installing the devices, to initialize a proper connection.
Edit: I did a quick update this morning that will re-initialize a device if you update it. Shouldn't need to reboot with that code.


#34

0.8 has been released for WW/CW CCT bulbs. Device states now update if the bulb is changed by some means outside of the app :slight_smile:

The rest of the devices are to follow.


#35

Hi,

Thanks for sharing this driver; I'm really looking forward to updates to mature it to a full release version.

I tried the code from 30 October and it seemed to be mostly working with my H801-based RGBW MagicHome Wifi controller.

However, today I updated to the latest code (0.71?), and was seeing NullPointerException errors. So I removed the Hubitat device and started over again.

When I set the server IP in preferences for the new device and hit save, I got this error:

java.lang.NullPointerException: Cannot invoke method socketConnect() on null object on line 531 (updated)

So the problem is that the socket connection can't be initialized because the main device string is null.

I did a quick compare of the code from 30 October and yesterday's release and the method for sending commands is totally different and there wasn't a function to initialize the socket connection.

I don't understand where the device string gets established so I'm afraid I can't help beyond reporting this error.

If it would help, I'd be happy to test any code changes. Thanks again!


#36

Interesting! I actually have one of those devices on-hand ... let me take a look.


#37

I forgot to import Socket in that driver. :crazy_face: Yesterday was a long day. Updating it in GitHub now.

Edit: Updated. :slight_smile:


#38

What firmware do you run on the h801?


#39

The one I tested is on the stock MagicHome firmware.

V4, on that one, I think.


#40

That updated RGBW controller code worked! However, it turns out my H801 controller is just RGB, one of these:


(Reported firmware is 33.v4.17.6445-A)

Before I switched to the RGB Controller device driver code, I made the controller available to my Alexa service via the Hubitat Skill, and while playing with setting the color / brightness in the Alexa mobile app, I noticed that the on state of the controller kept getting reset to "off" in the Alexa app. Meanwhile, in the Hubitat logs for the Amazon Echo Skill, I saw this error for every change I made:

Error processing device TV Lights: java.lang.NullPointerException: Cannot get property 'date' on null object

Then I changed to the RGB Controller device driver code and I was unable to set the color and brightness level. Here are the errors I was seeing (reordered to earliest on top, last on bottom):

(Click arrow to view log entries)
2018-11-07 19:25:54.246: debug MagicHome - Level set to 79

2018-11-07 19:25:55.270: debug Adding RGB via HSV conversion. H: 1.0 S: 1.0 L: 0.73

2018-11-07 19:25:55.312: error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'byte'. Try 'java.lang.Byte' instead on line 203 (setLevel)

2018-11-07 19:26:06.987: debug Adding RGB via HSV conversion. H: 0.97 S: 0.91 L: 0.86

2018-11-07 19:26:07.005: error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'byte'. Try 'java.lang.Byte' instead on line 203 (setColor)

2018-11-07 19:26:21.719:debugAdding RGB via HSV conversion. H: 0.17 S: 1.0 L: 1.0

2018-11-07 19:26:21.744: error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'byte'. Try 'java.lang.Byte' instead on line 203 (setColor)

So it seems that perhaps the code of the RGB Controller is not on parity with the RGBW Controller code? Something isn't working, anyhow. I'm sorry that I can't be of much more help than that.

Thanks again for working on these device handlers!