Hometechnica Community

Hometechnica Community is a community of amazing homies

Log in to customize your experience and get involved.

Create new account Log in
loading...
Cover image for I Talked To My IKEA Devices Using C#

I Talked To My IKEA Devices Using C#

Lars Richter
I'm a software developer located in Hamburg, Germany. I started my home automation / smart home journey in July 2020. I use Apple Homekit, homee and mostly IKEA smart bulbs.
Updated on ・2 min read

A while ago I read Ben's post about his own home automation suite called "HomeSweetHome".

And I am a developer, so I wanted to do the same, the moment I read it. 😄 But I dropped the plan because I had a lot of other stuff on my plate.

"Go. Do it. Write your own tool!"

That's what the little voice in the back of my head kept saying. So long story short, yesterday I started to check if my IKEA Tradfri Gateway has an API.

While googling around, I found that there is a way to communicate with the gateway. But there is no official support for it (yet). The API uses CoAP as the protocol. I haven't heard of CoAP before. So I dived right into it. Here is a short description from Wikipedia.

Constrained Application Protocol (CoAP) is a specialized Internet Application Protocol for constrained devices, as defined in RFC 7252. It enables those constrained devices called "nodes" to communicate with the wider Internet using similar protocols.

So, are you done?

No, I'm not. In fact, I just implemented the most basic code to create a new user on the gateway and request all the devices. No UI. No console output. Just a few unit tests that will execute my library. 🤷

Why this post?

Because this was so much fun to play with and to implement. Especially for something without official documentation. The best part: It worked.

And to be honest, my wife is not as enthusiastic as I am on that point. So I thought I might tell you (this nice community). 😄

I will share the code on GitHub some time in the future. So if you are interested, look out for my upcoming posts.

Discussion (1)

Collapse
ben profile image
Ben Halpern

Cool!