Hometechnica Community

Cover image for I Talked To My IKEA Devices Using C#
Lars Richter
Lars Richter

Posted on • Updated on

I Talked To My IKEA Devices Using C#

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)

ben profile image
Ben Halpern