Thanks. Still will not work for me. I get the network id, setup a new device in IDE which adds and says it is active but in ST app there’s a ? over the device and the settings do not do anything.
Are you sure you’ve used the 12 character ID which is in the equivalent position of the first line of the result example (“id”: “d3b2f2d97452”) here: http://api.developer.lifx.com/docs/list-lights ? There are other ones listed in the response too which relate to other things. Also, did you manually create the device via the IDE? Make sure you also select the customer device you created under “Type”.
You’ll need to be on the page while you try to interact with the device in your app. Watch out for any errors from the LIFX device, you can filter by device.
If want to send me a couple of screenshots I can have a quick look at your settings, the following should do:
LIFX Bulb LIFX Color Bulb Flat 4 Home Hub d073d5009e97 INACTIVE 5 hours ago
and:
Name LIFX BYLB
Label
Type LIFX Color Bulb
Version Published
Device Network Id d073d5009e97
Status INACTIVE
Hub Home Hub
Last Activity At 2015-11-01 11:48 AM GMT
Date Created 2015-11-01 11:38 AM GMT
Last Updated 2015-11-01 11:38 AM GMT
Data No data found for device
Current States No states found
Events List Events
In Use By
Log when I try to turn the bulb on:
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: error java.lang.NullPointerException: Cannot invoke method apiGET() on null object @ line 183
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: debug Executing ‘poll’ for LIFX BYLB script14462537021931168588872@23cd6f3 d073d5009e97
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: debug Executing 'refresh’
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: error java.lang.NullPointerException: Cannot invoke method apiGET() on null object @ line 183
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: debug Executing ‘poll’ for LIFX BYLB script14462537021931168588872@23cd6f3 d073d5009e97
2d4904ab-2988-4941-95dc-6f75d6d45f53 16:59:05 GMT: debug Executing 'refresh’
78ae8e7e-a2b2-469a-8049-10ded7cf6d64 16:59:00 GMT: debug Parse returned Duran’s iPhone has arrived
I’ll attach a screenshot of the app in a second post shortly.
Make sure you are creating a device of the device type that you added manually, which in my case is’ LIFX Bulb’ near the end of the list of devices, and then select the ‘Self-Published’ version to pick up your edited version of the code that contains your API key. I think you are mistakenly creating a ‘LIFX Color Bulb’ which is a different device type.
I concur with @xAPPO and suspect your issue is caused by the incorrect device type being selected. You should be able to change it as @xAPPO suggested and it will likely work.
When I create a custom smartapp from the code provided by @ian1 I am receiving the following error message when I try and hit save within the IDE:-
“groovy.lang.MissingMethodException: No signature of method: script1446920015985112640424.metadata() is applicable for argument types: (script1446920015985112640424$_run_closure1) values: [script1446920015985112640424$_run_closure1@383396d2]
Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)”
So to be clear - I have followed these steps:-
Create a new SmartApp from code - and pasted the code exactly as @ian1 said.
I inserted my LIFX API key from the LIFX website
Try to hit save and I get the above error.
Any ideas? Do I need to create the custom device first or something?
@DRoss - I am getting exactly the same problem as you with exactly the same output. What “Type” did you select? I have selected LIFX Color Bulb as that is exactly what it is. @xAPPO mentioned creating a device of the device type type that had been added manually - in his case “LIFX Bulb” I cannot see that device type.
@Will_Hogg, you will need to make sure the device type “LIFX Bulb” is selected not “LIFX Color Bulb” as the latter is the default one which will not work. “LIFX Bulb” is the custom device type which you will need to create beforehand.
Regarding the error you are experiencing, you should be creating a Device Type not SmartApp. This could be what is going wrong, with the method I suggested you only need to create a new device type and there is no need to create a SmartApp.
I wanted to see if you ever managed to get this working fro LIFX groups? I can’t seem to do it!
Obviously, it’s not totally necessary as we can just add each bulb individually, however then Smartthings turns them on in sequence and it’s not that aesthetically pleasing as having the whole group fade on in unison!