bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

HexBinary errors for udp devices in JSON? #422

Closed MisterC925 closed 7 years ago

MisterC925 commented 7 years ago

I have a limitlessled (mlight) I'm trying to integrate into everything using ha-bridge.

I had some success with early (1.x) versions of ha-bridge, but am trying to re implement using 4.1.0 since I want to put multiple commands in a json wrapper (turn on, change to white, for example0

The code I have is: [{ "item": "udp://255.255.255.255:8899/0x450055", "type":"udpDevice" }, { "item": "udp://255.255.255.255:8899/0x406055","type":"udpDevice" }]

When I attempt to turn on the lights I get a variety of exceptions relating to HexBinary.

This is one example: 2017-01-29 00:12:49,559 [qtp8001692-17] ERROR spark.webserver.MatcherFilter - java.lang.IllegalArgumentException: contains illegal character for hexBinary: 450055", "type":"udpDevice" }, { "item": "udp://255.255.255.255:8899/0x406055","type":"udpDevice" }]

If I have just a single UDP url (udp://255.255.255.255:8899/0x450055) it will work.

Please Advise

Thanks!

MisterC925 commented 7 years ago

Also if I remove the spaces from the json (so "item": "url" becomes "item":"url") I get this different exception: 2017-01-29 00:24:48,723 [qtp8001692-11] ERROR spark.webserver.MatcherFilter - java.lang.IllegalArgumentException: hexBinary needs to be even-length: 450055", "type":"udpDevice"

bwssytems commented 7 years ago

Confirmed. Will work on it.

bwssytems commented 7 years ago

It is confirmed if I put that into the item area, But the editor already does this for you. In the item area on the editor you need to put just this udp://255.255.255.255:8899/0x450055 and change the type to udpDevice and do an add to the right and then on the next line that is available underneath do that again with your other command, udp://255.255.255.255:8899/0x406055 and change the type to udpDevice and do an add to the right again then update the device with the button above.

MisterC925 commented 7 years ago

Thanks. I think I was looking at setup instructions (for limitlessled) based on a previous version of ha-bridge.

I'll try this now.

Thanks!

bwssytems commented 7 years ago

Is this resolved?

MisterC925 commented 7 years ago

Yes I verified using separate fields as as designed instead of how I was using it works ;-)

Thanks!