Nanoleaf's new light panels

The back side is just a flat white panel except for the 3 sets of contact pins and there’s not really a decent way to suspend them, unless you installed a piece of wood or mdf as a support across your archway for them to stick to. They also sell a corner support that screws on.

I got my API key. I know the key works because i cand send GET and PUT request. I am stuck with the IP:PORT to hex conversion. Below you will find my questions.

  1. What IP:PORT should I convert, the local ip and port of my aurora light? Example 192.168.1.140:16021 (not my actual ip:port)
  2. How can I convert both? Most of the converters I find only do the ip, not the port.
  3. Where in the ST code exactly I need to replace the HEX IP:PORT?

Thanks in advance for your help.

1 Like

You don’t need to put ip address in the code, just when setting up the device, use it as the device network ID (I think anyway). The format should be C0A801xx:3E95 (that’s 192.168.1.x and port 16021 converted to hex)

1 Like

@Edward_Niedziejko Thanks! That solve it.

I also updated the code to work with the v1 of the Nanoleaf API and ST “blue” color for “ON” state.

Do I still get the API key from the Maker plugin on IFTTT for the new device handler? If not, how do I use Bonjour to acquire it as referenced? Also, it looks like I don’t have to change my sceneList values in the code anymore. Does this API version completely bypass the IFTTT method referenced on the post right before it? Thanks for your help guys. I’m somewhat new to this.

Also, I’m having trouble finding the port that my Aurora is using. Any help appreciated.

You can go either route, IFTTT or API. Both work.
I notice a few differences between the two.

IFTTT
Turn On
Tuen Off
Change Color
Change Brightness
Change Scenes (including group scenes)
It cannot keep itself sync inside SmartThings with light status if you use manual input or Nanoleaf app.

API
Turn On
Turn Off
Change Color
Change Brightness
Change Scenes (doesn’t include grouo scenes)
It can keep itself sync inside SmartThings with light status even if you use manual input or Nanoleaf app (you need pollster or webcore or core).

Having said that, I went with API since its less cumberson and I can keep ST updated.

If you go with API, you will need your Aurora local IP and the API Key (authorizarion token).

The IP of your lights can be found using your router. Once you have them connected to your wifi, in your router menu, go to the section where it shows everything that os connected to your network and look for it, the default name of mine were somwthing like “IEEE…”. Once you locate them in your router you can see the info for them and see the IP assigned. It will look something like 192.168.1.XX
Search in google for “ip to hex converter” and convert you IP to hex.

As for the API Key, you will need to follow the procedure in the API documentation. In my case, I used an android app (REST Api Client) to send the initial command to enable the API authorization token.

Like any other Device Handler, copy the code into your IDE. Then, create a new device, assign the device handler and in the Device ID write the converte IP to hex. Example C0A801xx:3E95. Yes, include the “:3E95” that is the port converted to hex as well and is the same and default for all Aurora Lights (port 16021). Once you create the device, go to the preferences (settings) of your device and enter the API Key you obtained when you executed the enable procedure in the previous paragraph.

Hope this helps.

2 Likes

Okay I’ve got the IP address and port in hex now and I’ve got the DTH installed fine. I want to use the API version for sure. I’ve found the API documentation so I just need to figure out how to send the POST request to the authorization endpoint. How do I find said authorization endpoint? Is it /api/v1/new as suggested in the documentation? Can I use terminal on my raspberry pi or a Mac program or is an app the best route?

image

Would these settings work on this app I found on the iOS App Store or am I way off? I’d try it but I won’t be home for a few days.

The entire POST command would be

http://192.168.1.XX:16021/api/v1/new

Make sure you replace XX with you number.

1 Like

To me, easiest was to download the app and use it to test the API GET/PUT/POST.

Do you have any android device?

Yeah I do. I’ll try that app you suggested.

Well, I’m not having any luck getting this to work. I have the API version installed in my smartthings devices, I have the ip set, I have generated and pasted in the auth_token from Postman chrome plugin, but the device in Smartthings shows inactive and doesn’t display changes to the light, or allow control.

I’m having the same problem with converting the port to hex. How do I do that? One of my Auroras is on Port 16021 so I used your example for that one but the other one is on Port 6517. I can find any information online for converting port numbers… just IP addresses. Thanks so much for any insight you can be.

Found a calculator that will do it finally for those that have similar issue:

http://www.calculator.net/hex-calculator.html?d2bnumber1=6517&calctype=d2b&x=104&y=17#decimal2hex

Okay, I restarted from scratch, copied the code from the API version above, replaced /beta/ with /v1/ in the code, published for myself, created a device, added in my hexed ip:port and Aurora API key, and … still nothing. It creates a device in smartthings, I can click buttons, but it doesn’t DO anything to the light. What am I missing?

@Edward_Niedziejko I recommend you try to make it work with /beta/ first. Changing it to /v1/ requires more code changes to the API groovy code (at least for the scenes/effects to work).

Before you even try to make the smartthings device handler work, try to send some “PUT” and/or “GET” using your local IP:Port (not hex) and API Key to make sure you have all the correct ip, port and key. For example: “GET” http://192.168.1.XX:16021/api/v1/<auth_token>
Once you are sure of all three are correct, use the API groovy code above (with /beta/) to test. If yoy make the beta works, I can send you what I change in the code to make the v1 work.

I have two Auroras and both were in port 16021. That is the default port for them.

I deleted both the device and device handler, and copied fresh from the API version in this thread into create new device handler by code. I created a device using the device handler and entered the API key. My device says Status: Active in the Devices listing, but none of the controls work.

I’ve tested it with Postman plugin for Chrome, Get to http://192.168.x.x:16021/api/v1/6CDDHerdoiL(etc) returns 150 lines of device specific settings. Get to /beta/ instead of /v1/ also works.

I’ve triple checked my ip address hex conversion, but it shouldn’t say “active” if there’s no device there, right? I’m using C0A802xx:3E95 as my device network ID.

Update! It finally works! I have no idea what I did differently, but it’s working now. Color, brightness and on/off works. The arrows and listing for scenes does not, but it’s a start.

Edit: I know what my problem was. For local lan devices you have to set the smartthings hub. So far all my devices are cloud controlled, and I have had issues when I did set the smartthings hub so I’d been leaving it blank.

Great News that you have it working now.

When I changed the code to work with /v1/ of the API, I change he following lines. This solved the issue with the scenes.

Line 106:
def effectsList = message.json.effects.effectsList

Line 194:
log.debug("/api/v1/${apiKey}/${url}")

Line 199:
path: “/api/v1/${apiKey}/${url}”,

Line 211 (I know is commented, I wanted to keep it consistent):
//log.debug("/api/v1/${apiKey}/${url}")

Line 215:
path: “/api/v1/${apiKey}/${url}”,

I would like to do a Branch or whatever it is to the original code to make the changes and then submit it to be implemented by the author, but I haven’t done the research how to do it.