[OBSOLETE] IKEA Trådfri Bulb Device Type

Works perfectly, nice job!

All good now. Nice job.

I’ve made a simple change to anybody that is interested, or if @Edvald indeed wants to implement them, even better.

Added
command "nextColor"

Under setGenericName simply added
state.colourTemperature = value

Then added the following function

def nextColor() {
 if(state.colourTemperature < 2450) {
        setColorEveryday()
      } else if (state.colourTemperature < 2950) {
        setColorFocus()
      } else {
        setColorRelax()
      }
}

This is then exposed as a CoRe function which I trigger with a Xiaomi cube, meaning on each shake of the cube it will rotate between the preset temperatures (Everyday, Relax and Focus)

make a pull request =)

I just added that code and updated the handler, let me know if it doesn’t work as expected.

Did anyone manage to get the Github Automation working ? Even if i fork into my own repositories I cannot then see the New column which is really frustrating. I have this on two Handlers that out of four so I think it’s some permission set on GitHub maybe that is also transferred on the fork…

No, I’ve ended up having to paste the code directly in to the API - would love to see it set up as a Github setup that I can update, in the same way NST Manager works - that way if @Edvald updates the code, I can just do an update directly from the API.

Obviously, this requires work from @Edvald so we can only ask nicely and see if he can make the magic happen in the same way he has done with the code so far! :slight_smile:

@Edvald needs to restructure his folders and then it should work. Unfortunately SmartThings is very picky about the way the folders are structured to make it integrate seemlessly with GitHub.

Cool, found this : Can I add more than one GitHub Repository? for format.

it the only requirement is the folder structure then try this

https://github.com/edvaldeysteinsson/SmartThingsResources/blob/master/devicetypes/edvaldeysteinsson/ikea-tradfri.src/ikea_tradfri.groovy

Ahhh well, there was me being optomistic :slight_smile:

I can see the files now with the new Repo Path in the Update from Repo section, but they error out when trying to bring in. Deleted the Code based handler and then tried again rom the Repo and same error. Manually created new Code Handler from code in the new Repo Path and that works.

This is way beyond my knowledge and would be looking for help on this.

THANK YOU for trying BTW and THANK YOU for the excellent handler !

I have a suggestion but am not a very good programmer. My livingroom looks good when dimmed to the lowest setting when the temp is 2200K. But my kitchen does not look very well in the warmest light, even though i would like it to lower the temp a little when dimmed down. So, my suggestion is that the temp span could be modified in the device settings instead of “locked” in the DH. So some lights could change temp between, lets say, 2500-3000. And some between 2200-2700. This could maybe be really easy for a programmer? I could try it myself but we have just got a kid and I have trouble finding time.

The latest code has that

Oh! Sorry, great work!

I got really close, too - when you click to update from Repo the API saw two items to add new from Repo, but ticking them and clicking update gives me a 500 Error. If I only click the Tradfri DH, it pops back with “1 skipped due to errors”. I’ve tried renaming the namespace and the name of the copied DH that I’m using at the moment, but still no joy bringing in the new code.

That being said, it looks different to how NST Manager’s GitHub looks, but I am absolutely no expert, and really am not sure what the layout should be.

Here’s Edvald’s:

Here’s NST Manager’s:

Great work again, @Edvald.

Maybe it doesn’t like that I placed the image file in the devicetypes folder, I’ll try to restructure the repo during the weekend and make it a bit more like that one

1 Like

Great stuff! Will keep my eyes out for when it’s done, and if there’s anything I can do to help, just PM me (I’m guessing this allows PM? If not - Twitter!)

Just a side thought; as there’s a bit of a bug with the API right now, you might be able to use this to your advantage!

Currently, if I log in, I have to log in to the https://graph-eu01-euwest1.api.smartthings.com address rather than https://graph.api.smartthings.com/login/auth. If I log in to the second site, I get no locations, hubs, devices or device handlers, while if I log in to the first one, I can see everything.

It might be worth using the empty one to quickly test if a pull from your repo works or not?

For reference this one works for me and seems to be very much the same :

But there is not the “This path skips through empty directories” of the link (devicetypes/edvaldeysteinsson/ikea) under your SmartThingsResources directory Edvald, but the IDE still get’s to the .groovy file. You are correct in stating that your .png file is also different.

Yeah, that’s two Smartthings GitHub repos that have a Smartapp and a Devicetypes folder at the top level… I’m guessing that’s the key?

If you are referring to that github shows the path as one folder called “devicetypes/edvaldeysteinsson/ikea-tradfri.src” then that’s just the way the github web gui displays it, the folder structure is actually there. I just moved the image so if you guys want to retest it i would appreciate it. The other folders might still break it though.