Danfoss living connect, new proprietary z-wave binding

Hi Christian

Can i get access to the repo to?

bitbucket: merciwima

Hi Christian,

Do you get access to all the link units, e.g. floor heating valves, temperature measurements, air circulation (Danfoss air A2), etc.?
I am currently getting a new house built, and I am thinking whether I should install the proprietary Danfoss system, and try to use your solution. I am willing to extend the features in your code, if necessary.
The alternative is of course to install something else than Danfoss, but it is hard to find other systems that integrate everything out off the box.

May I please get access to your repo.

@ChristianHC Sounds very nice, looking forward to see/contribute to the repo. Can you invite me too? bitbucket username: ksvendsen

@ChristianHC Is it possible to get access to the repo?

Did you make any progress with making the controller work?

I have a Danfoss CC controller and a Danfoss heat pump that I would like to get information from.

@wojciii You are added.

So an update to those still following the thread.

In the Repo is a decompiled Danfoss Link android application with all the sourcecode. Its compileable and you can connect to your own MDG servers. However, due to me removing the android support library there are several bugs in the UI. For one, when you need to pair the screen is empty. Keep pressing next until you can write in you pairing code, wait a bit and you should be paired. You can follow the logs and step through the code when doing this.

I initially tried to run the libmdg.so file on a raspbery pi (The same arm architecture as the phone), but since the file is linked towards androids bionic-c library it cannot run on vanilla linux/debian out of the box. It should be possible to relink it (I’ve seen it mentioned a couple of times) but i am not a daily linux user and have thus abandonded this.

The other approach is the run the lua sourcecode by yourself, however several of the needed libraries are hardcoded in the libmdg.so files. I have found several alternatives (For windows), but i havent been succesful in running it. The precompiled Lua files mentions a windows sandbox configuration, so i suspect that the Trifork people have been testing and running it on one, and thus is suspect that it should be possible. However i’m not a lua coder so progress is slow at the moment.

Other attack angles are to completely disregard the existing code and start from scratch. You will need a way to generate SSL/TLS certification using the brainpool ec curve, establish a tunnel to the mdg server and communicate via protobuf. - I’ve already decompiled the protomaps and they are available in the repository.

Im also interested to hear from the people who have had access to the repository whether or not they have made any progress

I’m not added. :slight_smile:

My bitbucket is here: https://bitbucket.org/wojciii/

@ChristianHC could you give me access to the repo please?
My bitbucket account is: https://bitbucket.org/misncz

Can you pleae also authorize me? https://bitbucket.org/mwagner80

Original comment (Deleted so my bitbucket link disappers in due time :slight_smile: ):
Hi!

I have a cottage with Danfoss Link. I have the app working but there are more smart things in there and would like to explore options of having them all on the same app. Can I have access to the repository?

My end goal would be to have like a raspberry on the cottage network to which I can connect how I want and control as many things as possible :slight_smile: I’m a newbie but I’m trying to learn.

Hi Christian

amazing reading; what you have managed to solve in this issue.

I’m also looking for a solution how to connect my Danfoss Living CC system to Home Assistant home-assistant.io

Please share https://bitbucket.org/janushansen/

I still have no access to any code. There were no changes to my bitbucket account that I could see for the past few days.

Could someone post instructions about how to get access to the source code for the decompiled app?
What is the link to the repo you talk about? How do I clone it?

No activity? What happened?

Just stumbled upon a similar approach here that might interest some of you:
https://jope.eu/danfoss-living-connect-in-hass/
It uses the Alexa integration which I believe is officially supported by Danfoss. However, it might require a paid Alexa account.

Hi Christian,

bitbucket: Tuck_

Could i get access i’m looking into creating link for google assistent to work with it :slight_smile:

Hi All,
@Tuck08,@morten235, @wojciii,@janushansen, @Jere, @marco80, @misncz

I haven’t had any time to look more into this, however all the code for the decompiled app is here: https://we.tl/t-L47bkmW6uC
There haven’t been any updates to the app on the google play store so it is the same code. What is needed is to get either the library or the lua code to run on other systems than android. This requires somebdy skilled in Lua or Linux, which is not me.

Also, there are rumors that Danfoss is working with TriFork in regards to an open API: You can read more here: https://github.com/trifork/secure-device-grid/issues/4

Hi everyone, meet yet another angry Danfoss product owner onboard. :skull:
I have DeviSmart floor thermostat and also want to integrate it. I’ve read the thread and some links. My takeaways:

  1. The whole thing is using trifork mdg.
  2. mdglib published on github isn’t compatible with Danfoss products. Neither Danfoss products are compatible between themselves. But it can be used as a reference.
  3. It seems to be that application-level protocol is text-based.
  4. But it’s forbidden to use mdglib without license.
    I’d like to know what exactly you are working on. Are you trying to reverse engineer mdglib in order to be able to reimplement the tunnel? You’re talking about lua. Does it mean mdglib core is written in lua? Or is this monstrocity located inside DanfossLink app itself?
    P.S. I know that DL belongs to a product line different from DeviSmart.
    P.S. There was a suggestion to relink mdglib from Android to Linux, i can tell this is not possible due to binary incompatibility. But there is a solution called libhybris, it can be used at least for research purposes.

Hello everyone! Is there anyone reading this?
I’ve recently made some progress. First of all, i was able to reverse engineer a protocol, running inside the tunnel. Now i want to modify mdglib demo app to talk to my DeviSmart using a library extracted from the app APK. I have a rooted Android device to run this contraption. The Android library has both JNI and native entry points, so building the testapp was an easy task.
I have also looked into the lib itself. I found no LUA engine, neither any scripts. However i found sodium library in there: https://download.libsodium.org/doc/ . This is what they are using as a crypto engine.
At the moment my app doesn’t work due to mdg_init() error. Unfortunately error codes are not documented; neither there is anything on logcat. However, i’ve noticed that the app generates a private key, so callbacks are being called. They likely return something wrong; need to inspect them versus original Java stubs.
Also now i know that Danfoss config, published in the github repo, is correct; but the published library indeed fails to connect. However, i am in doubt that there is some big difference, most likely it has to do with built-in license key.
Plan to continue fighting today.

3 Likes

Hi Pavel,
The main difference between the Danfoss and the Devi implementation is the library they use for establishing a secure tunnel. Danfoss uses a brainpool curve and Devi the libsodium library you mentionded.
When the tunnel is established, both apps coomunicate with MDG through google’s protobuf library.
The reason you cannot connect to Danfoss using the demo code from trifork is because it is using the Devi implementation.

The lua sourcecode was included in the Danfoss APK in an earlier version. I’ve sent you an invitation to my bitbucket repo which contains the Protobuf descriptors needed to “decrypt” the communication as well as the LUA sourcecode.

From likes i see somebody is reading this thread. Meanwhile i started a new one: DEVIReg Smart thermostat binding
Some recap:

  1. I have a demo code which talks to my thermostat and reads the data.
  2. I have got an insight into tunneling protocol and soon i will start working on a free and open communication library.
    Current evaluation and technology demo code is available here: https://github.com/Sonic-Amiga/DEVIComm . Should also be useful for all who want to work on Living Connect.

Since it is Z-Wave, I think it should possibly be integrated into the existing Z-Wave binding.