The Proliphix IMT350c

Proliphix added a new series of Thermostats to their product line: the IMT350. Two models are available; the IMT350c with wired Ethernet and the IMT350w with WiFi. I won’t go into their details, the Proliphix site has all the information you need. I was lucky to receive a IMT350c a few days ago – a Domoticaforum member bought one, but since the Thermostat didn’t work in combination with the Homeseer Proliphix Plugin, it was rather useless to him; so I was asked to have a look at it. Yeah, I always like those kind of questions 🙂

As a coincidence, some time ago I received the source code for the Homeseer Proliphix Plugin to add Celsius support to it. The Homeseer guys are too busy with all kinds of things but not with this Plugin, so they agreed on a 3rd party (eventually being me) to add the Celsius support. Adding Celsius support had already been done, and now suddenly I had this IMT350… and i knew the Plugin didn’t work with that model, so sounds like a good opportunity to fix that problem too..
First some pics of the IMT350 (click for larger image):
Proliphix IMT350c IMT350 Touchscreen
IMT Base Plate IMT350c back side
IMT350c USB connector?

Now that last one is a bit strange; do I see a USB connector there?? It sure looks like it; but since this Thermostat isn’t mine, I’ll leave the plugging in of a USB cable to the owner; I don’t want to destroy anything… I searched the manuals, but I couldn’t find any information about this USB port.

The IMT350 series Thermostats have a nice Touchscreen, which feels good and the up- and down-buttons for setting the temperatures are responsive enough. With my NT20e I sometimes had the problem that I clicked the buttons too often cause the Thermostat didn’t react fast enough; that’s gone now. The bottom row of buttons seem to react a bit slower though. Please don’t think I’m reviewing this Thermostat; I’m just telling my experiences I’ve had with it for a very short period; not long enough to be precise and conclusive. One thing surprised me was that the Thermostat takes more than 2 minutes to boot; that’s rather long, if you ask me. For the rest: this thermostat definitely looks much better compared to the NT20e, but still, I wouldn’t call this an “eye-catcher” in my house…

OK, let’s do some research on this IMT350! Connecting the Thermostat to my network was easy; the thermostat has DHCP so after connecting an Ethernet cable to the EPA-20 (Ethernet Power Adapter) and plugging the power adapter into a wall socket, I could start using the web-interface right away. I entered the factory set username and password and there it was. Time to start my own Domotica system and see if I can use this Thermostat; nope. I immediately got an exception on the first login attempt: HTTP/1.1 401 Authorization Required. Somehow I couldn’t authenticate, so I started Wireshark and looked at the conversation:

GET /get?....... HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: 192.168.10.155
Accept: text/html, */*
Accept-Encoding: identity
User-Agent: Mozilla/3.0 (compatible; Indy Library)
Authorization: Basic YCRWaS43YDRTaX4=

HTTP/1.1 401 Authorization Required
Connection: close
Date: Fri, 01 Jan 2010 01:36:20 GMT
Server: Cherokee/0.99.37 (UNIX)
WWW-Authenticate: Digest realm="proliphixrealm", nonce="0572700e162cb40274041d07e8b87252", qop="auth", algorithm="MD5"
Content-Length: 450
Content-Type: text/html
Cache-Control: no-cache
Pragma: no-cache

Aah… Digest Authentication instead of Basic… Since I’m using Borland Delphi 2005 with Indy 10, I first had to partially finish the Digest Authentication code of Indy 10, cause it didn’t work. 🙁

After that, I could authenticate and communicate with the IMT350 just like I do with my NT20e. That’s it… all the information that I’m used to retrieve from my NT20e, came out the same way with this IMT350!

Wow, that was easy 🙂

Next step, the Homeseer Proliphix Plugin. Adding Digest Authentication to VB.NET was even simpler:

Dim wrCache As CredentialCache = New CredentialCache
Dim netCredential As NetworkCredential = New NetworkCredential(Me.User, Me.Pass)
wrCache.Add(New Uri(URL), “Digest”, netCredential)
MyWebRequest.Credentials = wrCache

Done! Launching Homeseer and configuring a new Thermostat was all that had to be done. When the Proliphix PlugIn starts up, it recognizes a potential HTTP 401 error and if this error does occur, the Plugin will retry with Digest authentication, so that both series (NT and IMT) can be supported at the same time. Here’s the result:

Homeseer Proliphix Plugin

Homeseer Proliphix Plugin with IMT350 and NT20

Tagged , , , . Bookmark the permalink.

7 Responses to The Proliphix IMT350c

  1. jjh says:

    Are all Proliphix thermostats compatible with Opentherm / modulated central heating?

    • Sorry, my spam filter caught you, that’s why it took a bit longer.
      No, the Proliphix thermostats I know (NT series and also this IMT series) do not support Opentherm/modulation: on/off, that’s all..

  2. Kashif says:

    Can you please show what changes you made to Indy code?

    And what indy version did you applied it to?

    TIA

    • Hi Kashif, I’m using Indy 10 that comes with Delphi 2005. The file IdAuthenticationDigest.pas in the Protocols directory has been modified. The following things were changed:
      1.
      Line 191:
      //FAlgorithm := Params.Values['algorithm'];
      FAlgorithm := Copy(Params.Values['algorithm'], 2, Length(Params.Values['algorithm']) - 2); {do not localize}

      2.
      In the initialization section, uncomment the RegisterAuthenticationMethod() call.

      3.
      The authentication function was rewritten:
      function TIdDigestAuthentication.Authentication: String;
      var
      HA1,HA2:String;
      Response:string;
      Fcnonce:string;

      function ResultString(s: String): String;
      Var
      MDValue: T4x4LongWordRecord;
      i: Integer;
      S1: String;
      LHash : TIdBytes;
      begin
      with TIdHashMessageDigest5.Create do begin
      MDValue := HashValue(S);
      Free;
      end;
      LHash := ToBytes(MDValue[0]);
      AppendBytes(LHash,ToBytes(MDValue[1]));
      AppendBytes(LHash,ToBytes(MDValue[2]));
      AppendBytes(LHash,ToBytes(MDValue[3]));

      for i := 0 to 15 do begin
      S1 := S1 + Format('%02x', [LHash[i]]);
      end;
      while Pos(' ', S1) > 0 do S1[Pos(' ', S1)] := '0';
      result := Lowercase(S1);
      end;

      begin

      Fcnonce:=ResultString(IntToStr(random(1000)));
      HA1:=ResultString(username+':'+FRealm+':'+password);
      HA2:=ResultString('GET'+':'+'/');
      Response:=ResultString(HA1+':'+Fnonce+':'+'00000001:'+Fcnonce+':'+'auth'+':'+HA2);

      result := 'Digest ' + {do not localize}
      'username="' + Username + '", ' + {do not localize}
      'realm="' + FRealm + '", ' + {do not localize}
      'nonce="' + Fnonce + '", ' + {do not localize}
      'uri="' + '/'+'", ' + {do not localize}
      'cnonce="' + Fcnonce+'", ' + {do not localize}
      'nc=00000001, ' + {do not localize}
      'algorithm=' + FAlgorithm+', ' + {do not localize}
      'response="' + Response + '",qop="auth"'; {do not localize}
      end;

      This worked for me, but as you can see I made some quick & dirty assumptions:
      – Authentication takes place with a GET /;
      – the cnonce is generated based on a random(1000);
      – counter always starts at 00000001.

      Basically, I implemented those things the Thermostat needed for a successful authentication, nothing more.
      So I don’t expect this to work in all situations, but for now, I can live with that. Maybe you can too 🙂

  3. Kashif says:

    Thanks for the code. I will check it out.

    Can you please tell me what settings were used on the client component? Code?

    you must be using idHTTP right?

    I need this to connect to a webdav server using idWebDav component.

    Thanks

    • You’re right, and the code is like this:

      HTTPClient := TidHTTP.Create(nil);
      HTTPClient.Request.Method := hmPost;
      HTTPClient.Request.ContentType :='application/x-www-form-urlencoded';
      HTTPClient.Request.BasicAuthentication :=True;
      HTTPClient.HTTPOptions := HTTPClient.HTTPOptions+ [hoInProcessAuth];
      HTTPClient.Request.Username :=username;
      HTTPClient.Request.Password :=password;
      HTTPClient.ReadTimeout:=10000;
      HTTPClient.OnAuthorization := AuthProc;
      HTTPClient.HandleRedirects := True;
      HTTPClient.request.Authentication := TIdDigestAuthentication.Create ;
      URL := TIdURI.URLEncode(URL);
      Response:=HTTPClient.Get(URL);

      The Authproc mentioned looks like this:
      procedure TPDPAPIWorkerThread.AuthProc(Sender: TObject; Authentication: TIdAuthentication; var Handled: boolean);
      begin
      Handled:=True;
      end;

      HTH,
      Robert.

  4. Pingback: Proliphix Plugin finished

Leave a Reply

Your email address will not be published. Required fields are marked *