Author Topic: proliphix nt150  (Read 1907 times)

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
proliphix nt150
« on: August 19, 2012, 02:44:00 am »
I just installed my new thermostat as it had a driver written for it already.  My problem is that the device shows up as a climate device, but no scenarios were generated automatically.  Also, when I try to add one, there is no climate device available.  If I look at my devices section, it is definitely there.  If I go to the floorplan, it shows it with some options for control.  What should I try?

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #1 on: August 19, 2012, 09:04:23 pm »
I don't think LinuxMCE automatically generates any default climate scenarios (at least 0810 and 1004 didn't do that for me with my Proliphix thermostat).

What I did, personally, is make some scenarios that set the temperature to a certain level. I have three; 18C, 21C and Auto. I added them to all the rooms, since my thermostat controls the temperature for the whole house.

Furthermore I made some events to react to the changing of the house mode, when I leave the temperature is set to a low value and when I come back the thermostat is set to follow its normal program.

BTW to "follow the normal program" a little update of the driver is needed; I added it to the thermostat's "On" command. The version currently in the database just starts with the set-point it left off if it receives an On command. If others are intersted I'll put that in a patch.

Also, are you running 0810 or 1004? I installed 1004 today, but it had problems auto-detecting the thermostat. It seemed like part of the device template was missing. So I'll probably have to make a driver patch anyway.

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
Re: proliphix nt150
« Reply #2 on: August 20, 2012, 07:29:25 pm »
im on 1004.  i have it added and it shows up in the climate devices section.  but even without it not creating the climate scenarios, i can't add a manual one.  it just tells me that there are no climate devices available.  is it supposed to have autodetect?  that section of the template doesn't have anything in there.

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #3 on: August 21, 2012, 12:55:48 pm »
Hang on, you added it manually?

I currently do not have access to my home system, but this is what I remember having to do manually to get it to work:
- "Controlled by" should be set to CORE, otherwise the device will not even start, this might be the problem you are facing. (Also, if this is the case and you try to view the log you get a message that the log - does not exist).
- The MAC address and IP address were not filled in automatically, had to do that manually (got some error message about "conn_" not existing in the log file).
- The TCP port was not present in the device data (I think this also got me the "conn_" error, but the TCP port was mentioned somewhere earlier in the log)
- The username and password were not present in the device data (The log showed some error on some line involving this device data, 142 and 143 IIRC)

Also check if the "Disable" field of the device is set. Whenever an error is encountered that LinuxMCE cannot recover, it disables the device. So fixing the above only helps if you also enable the device again (and do a Quick reload of the DCERouter).

Eventually I just fixed the device template, removed the device and had it auto-detected correctly. I'll see if I can make a patch this evening, that might be easier than doing all of this.

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #4 on: August 21, 2012, 08:17:16 pm »
I created a trac ticket and did a checkin of sqlCVS:
http://svn.linuxmce.org/trac.cgi/ticket/1547
If one of the devs would be so kind as to verify it and check it in, I would appreciate it.

EDIT: Just out of curiousity, is there a way to test this change on someone else's system (like iberium's) without first checking it in in the main database?
« Last Edit: August 21, 2012, 08:19:39 pm by mhorst »

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
Re: proliphix nt150
« Reply #5 on: August 28, 2012, 01:59:37 am »
What is the normal process for a template to get updated to where I can get the updates from the server?  Is it just when there is time available or do they test it somehow?  Thanks for repairing it, I just can't wait to be able to try it out :).  I program crestron, savant, and control4, and mce seems to have features that just arent available to the others or easily available to the others.  ive been running it at my house and love it!

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #6 on: August 28, 2012, 07:52:07 pm »
I'm not quite sure. This is the first, and so far only, driver I wrote for LinuxMCE.
But I just did a SQL diff and it didn't show any of my changes, so that should mean the changes are in the data base.

Try doing a sqlCVS update from your webadmin. It's under Advanced->sqlCVS. The changes I did were under "dce", I'm not sure which one, just use "check all".

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2986
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: proliphix nt150
« Reply #7 on: August 28, 2012, 07:59:28 pm »
The checkin must be approved. For that, we need to know the batch no. Should be negative IDs. Look at schema.linuxmce.org/sqlCVS/?site=batch/view to see what number(s) belong to your checkin, and update your ticket.

Thanks.

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
Re: proliphix nt150
« Reply #8 on: September 12, 2012, 07:55:01 pm »
It doesn't look like the driver ever got pushed through.  I went into the schema page and made the changes that it showed, all but the plug and play info where it adds itself automatically to the core.  I now get the following error and then it disables itself.  This is the log:

== ATTEMPT FRESH START ==
1   09/12/12 12:50:11   /usr/pluto/bin/Spawn_Device.sh 148 (spawning-device)   24184 Dev: 148; Already Running list: 15,16,18,19,29,30,31,87,38,21,22,25,23,50,56,59,26,27,54,
== FRESH START ==
1   09/12/12 12:50:11   /usr/pluto/bin/Spawn_Device.sh 148 (spawning-device)   device: 148 ip: localhost cmd_line: Generic_Serial_Device
0   09/12/12 12:50:11   148 (spawning-device)   Entering 148
========== NEW LOG SECTION ==========
1   09/12/12 12:50:12   148 (spawning-device)   Starting... 1
1   09/12/12 12:50:12   148 (spawning-device)   Found /usr/pluto/bin/Generic_Serial_Device
RCODE:
   0:require 'Ruby_Generic_Serial_Device'
   1:class Command < Ruby_Generic_Serial_Device::RubyCommandWrapper
   2:end
   3:class Device_148 < Ruby_Generic_Serial_Device::RubySerialIOWrapper
   4:#### 192 ####################################################################
   5:def cmd_192(pk_pipe, pk_device_pipes, cmd=nil)
   6:@returnParamArray.clear
   7:data="OID4.1.1=" # Current mode of HVAC operation
   8:data+="4" # Auto
   9:pdp_set(data)
  10:return @returnParamArray
  11:end
  12:#### 193 ####################################################################
  13:def cmd_193(pk_pipe, cmd=nil)
  14:@returnParamArray.clear
  15:data="OID4.1.1=" # Current mode of HVAC operation
  16:data+="1" # HVAC is not active
  17:pdp_set(data)
  18:return @returnParamArray
  19:end
  20:#### 278 ####################################################################
  21:def cmd_278(value_to_assign, cmd=nil)
  22:@returnParamArray.clear
  23:if ((value_to_assign[0,1]=="+") || (value_to_assign[0,1]=="-"))
  24:  # The new setpoint is relative to the current setpoint
  25:  new_temp = @setpoint + value_to_assign.to_i
  26:else
  27:  # The new setpoint is absolute
  28:  new_temp = value_to_assign.to_i
  29:end
  30:
  31:data="OID4.1.5=" # Current heat setpoint in deci-degrees Fahrenheit
  32:data+=celcius_to_decifarhenheit(new_temp).to_s
  33:pdp_set(data)
  34:return @returnParamArray
  35:end
  36:#### 279 ####################################################################
  37:def cmd_279(onoff, cmd=nil)
  38:@returnParamArray.clear
  39:data="OID4.1.3=" # Current mode of fan operation
  40:if onoff == "1"
  41:  data+="2" # Fan is always on
  42:else
  43:  data+="1" # Auto
  44:end
  45:pdp_set(data)
  46:return @returnParamArray
  47:end
  48:#### 280 ####################################################################
  49:def cmd_280(onoff, cmd=nil)
  50:@returnParamArray.clear
  51:data="OID4.1.1=" # Current mode of HVAC operation
  52:if onoff == "H"
  53:  data+="2" # Heat only
  54:elsif onoff == "C"
  55:  data+="3" # Cool only
  56:else
  57:  data+="4" # Auto
  58:end
  59:pdp_set(data)
  60:return @returnParamArray
  61:end
  62:#### 350 ####################################################################
  63:def cmd_350(cmd=nil)
  64:@returnParamArray.clear
  65:conn_.Close()
  66:return @returnParamArray
  67:end
  68:#### 351 ####################################################################
  69:def cmd_351(cmd=nil)
  70:@returnParamArray.clear
  71:# Check how long it has been since we queried the thermostat
  72:now = Time.new
  73:if ((@last_check + 300) < now)
  74:  # The last check was more than 5 minutes ago
  75:  update_state()
  76:end
  77:return @returnParamArray
  78:end
  79:#### 355 ####################################################################
  80:def cmd_355(cmd=nil)
  81:@returnParamArray.clear
  82:# Initialize the internal state
  83:@hvac_mode = 0
  84:@fan_mode = 0
  85:@temperature = 0
  86:@setpoint = 0
  87:@time=Time.at(0)
  88:@last_check = Time.at(0)
  89:
  90:# Update the state
  91:update_state()
  92:return @returnParamArray
  93:end
  94:#### PRIVATE METHODS ####################################################################
  95:def log(line)
  96:  # This function logs a line to the log file of the device
  97:  log = File.open("/var/log/pluto/" + device_.devid_.to_s + "_Generic_Serial_Device.log", "a")
  98:  log.puts Time.now.to_s + " (Ruby script):" + line.to_s
  99:  log.close
 100:end
 101:
 102:def pdp_set(data, update=true)
 103:  # This function sets data via the PDP interface,
 104:  # and then updates the state of the thermostat (if update == true)
 105:
 106:  # Reconnect to the device
 107:  conn_.Reconnect()
 108:
 109:  # Compile authentication data
 110:  auth_s=device_.devdata_[114]+":"+device_.devdata_[115]
 111:  auth_a=Array.new;
 112:  auth_s.each{|c| auth_a.push(c)}
 113:
 114:  # Compile the request
 115:  s = "POST /pdp HTTP/1.1\r\n"
 116:  s+= "Authorization: Basic "+auth_a.pack("m").chop+"\r\n"
 117:  s+= "Content-Length: " + (data.length+14).to_s() + "\r\n"
 118:  s+= "\r\n"
 119:  s+= data+"&submit=Submit\r\n"
 120:  s+= "\r\n"
 121:
 122:  # Send the request
 123:  conn_.Send(s)
 124:
 125:  # Wait for a reply
 126:  recv=""
 127:  while(true)
 128:    buff=conn_.Recv(256, 5000)
 129:    if(buff.length() == 0)
 130:       break
 131:     end
 132:     recv = recv +  buff
 133:  end
 134:
 135:  # Update the state to reflect the new situation
 136:  if (update)
 137:    update_state()
 138:  end
 139:end
 140:
 141:def pdp_get(data)
 142:  # This function gets data via the PDP interface
 143:
 144:  # Reconnect to the device
 145:  conn_.Reconnect()
 146:
 147:  # Compile authentication data
 148:  auth_s=device_.devdata_[114]+":"+device_.devdata_[115]
 149:  auth_a=Array.new;
 150:  auth_s.each{|c| auth_a.push(c)}
 151:
 152:  # Compile the request
 153:  s = "POST /get HTTP/1.1\r\n"
 154:  s+= "Authorization: Basic "+auth_a.pack("m").chop+"\r\n"
 155:  s+= "Content-Length: " + (data.length+1).to_s() + "\r\n"
 156:  s+= "\r\n"
 157:  s+= data
 158:  s+= "\r\n"
 159:
 160:  # Send the request
 161:  conn_.Send(s)
 162:
 163:  # Wait for a reply
 164:  recv=""
 165:  while(true)
 166:    buff=conn_.Recv(256, 5000)
 167:    if(buff.length() == 0)
 168:       break
 169:     end
 170:     recv = recv +  buff
 171:  end
 172:
 173:  # Parse the reply
 174:  r = recv.split("=") # Split along the "=" marks
 175:  r.delete_at(0)      # The first element is the HTTP header, remove it
 176:
 177:  results = Array.new
 178:  r.each do |p|
 179:    results.push(p.split("&")[0]) # Everything up to the ampersand is the result
 180:  end
 181:
 182: return results
 183:end
 184:
 185:def decifarhenheit_to_celcius(cf)
 186:  # Converts a temperatue in deci-Farhenheit into degrees Celcius
 187:  return (((cf - 320)*5)/90)
 188:end
 189:
 190:def decifarhenheit_to_decicelcius(cf)
 191:  # Converts a temperatue in deci-Farhenheit into deci-degrees Celcius
 192:  return (((cf - 320)*5)/9)
 193:end
 194:
 195:def celcius_to_decifarhenheit(c)
 196:  # Converts a temperatue in degrees Celcius into deci-Farhenheit
 197:  return (((c*90)/5)+320)
 198:end
 199:
 200:def update_state()
 201:  # This function queries the thermostat to get the most recent state
 202:  log("Polling thermostat for updates")
 203:
 204:  data ="OID4.1.1=&" # Current mode of HVAC operation
 205:  data+="OID4.1.3=&" # Current mode of fan operation
 206:  data+="OID4.1.5=&" # Current heat setpoint in deci-degrees Fahrenheit
 207:  data+="OID4.1.13=&" # Current averaged temperature in deci-degrees Farhrenheit
 208:  data+="OID2.5.1=&" # System time in seconds since Jan 1, 1970
 209:
 210:  results = pdp_get(data)
 211:
 212:  # Get the new states
 213:  new_hvac_mode = results[0].to_i # 1-Off, 2-Heat, 3-Cool, 4-Auto
 214:  if (results[1].to_i == 1)
 215:    # Always on
 216:    new_fan_mode = 2 # On
 217:  else
 218:    # Auto/Schedule
 219:    new_fan_mode = 0 # Auto
 220:  end
 221:  new_setpoint = decifarhenheit_to_celcius(results[2].to_i)
 222:  new_temperature = decifarhenheit_to_decicelcius(results[3].to_i)
 223:  new_time = Time.at(results[4].to_i - Time.now.utc_offset) # Time.at creates a UTC time, wheras the thermostat reports the time in the local time zone
 224:
 225:  # Update the state and send events when necessary
 226:  if (new_hvac_mode != @hvac_mode)
 227:    log("  New mode detected : " + new_hvac_mode.to_s)
 228:    if (@hvac_mode == 1)
 229:      # The old mode was "Off", so now the thermostat is on
 230:      cmd = Command.new(device_.devid_, -1001, 1, 2, 28) # On
 231:      SendCommand(cmd)
 232:    end
 233:    if (new_hvac_mode == 1)
 234:      # The new mode is "Off", so we send the Off event:
 235:      cmd = Command.new(device_.devid_, -1001, 1, 2, 29) # Off
 236:      SendCommand(cmd)
 237:    else
 238:      # We send the Thermostat mode changed event:
 239:      cmd = Command.new(device_.devid_, -1001, 1, 2, 78)
 240:      cmd.params_[30] = (new_hvac_mode - 1).to_s
 241:      SendCommand(cmd)
 242:    end
 243:    @hvac_mode = new_hvac_mode
 244:  end
 245:
 246:  if (new_fan_mode != @fan_mode)
 247:    @fan_mode = new_fan_mode
 248:    log("  New fan mode detected : " + @fan_mode.to_s)
 249:    cmd = Command.new(device_.devid_, -1001, 1, 2, 79) # Fan Mode Changed
 250:    cmd.params_[30] = @fan_mode.to_s                   # Fan mode value (0,1 - Auto / LOW; 2,3 - High)
 251:    SendCommand(cmd)
 252:  end
 253:
 254:  if (new_setpoint != @setpoint)
 255:    @setpoint = new_setpoint
 256:    log("  New temperature setpoint detected : " + @setpoint.to_s)
 257:    cmd = Command.new(device_.devid_, -1001, 1, 2, 27) # Thermostat Set Point Chan
 258:    cmd.params_[30] = @setpoint.to_s                   # The new set point
 259:    SendCommand(cmd)
 260:  end
 261:
 262:  if (new_temperature != @temperature)
 263:    @temperature = new_temperature
 264:    log("  New temperature measurement detected : " + (@temperature/10.0).to_s)
 265:    cmd = Command.new(device_.devid_, -1001, 1, 2, 25) # Temperature changed event
 266:    cmd.params_[30] = (@temperature/10.0).to_s         # The ambient temperature
 267:    SendCommand(cmd)
 268:  end
 269:
 270:  # Check the latest system time
 271:  @time = new_time
 272:  if ((@time-Time.now).abs > 600)
 273:    # Time is out of sync for more than 10 minutes
 274:    log("Thermostat's time ("+@time.to_s+") is out of sync with system time ("+Time.now.to_s+"), resynchronizing")
 275:    data="OID2.5.1=" # Current system time in seconds since Jan 1, 1970
 276:    data+=(Time.now + Time.now.utc_offset).to_i.to_s # Time.to_i returns seconds since epoch in UTC, wheras the thermostat expects the time in seconds since epoch in the local time zone
 277:    pdp_set(data, false)
 278:  end
 279:
 280:  # Record the last time the state was checked
 281:  @last_check = Time.now
 282:
 283:end
 284:#### START SETTERS ####################################################################
 285:def initialize()
 286:super
 287:@returnParamArray=Array.new
 288:end
 289:####  END  SETTERS ####################################################################
 290:end
292:Wed Sep 12 12:50:13 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:13.179      Error while calling method: Cannot call class method: cmd_355
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):91:in `cmd_355'
 <0xb509bb70>
Wed Sep 12 12:50:14 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:14.964      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:16 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:16.998      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:18 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:19.032      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:21 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:21.112      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:23 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:23.166      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:25 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:25.213      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:27 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:27.244      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:29 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:29.274      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:31 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:31.303      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:33 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:33.333      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:35 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:35.376      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:37 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:37.405      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:39 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:39.434      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:41 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:41.462      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:43 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:43.489      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>
Wed Sep 12 12:50:45 -0500 2012 (Ruby script):Polling thermostat for updates
01   09/12/12 12:50:45.640      Error while calling method: Cannot call class method: cmd_351
error: undefined method `+' for nil:NilClass, line: 148
backtrace:
   in: (eval): 148
   from (eval):148:in `pdp_get'
   from (eval):210:in `update_state'
   from (eval):75:in `cmd_351'
   from (eval):148
 <0xb509bb70>

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #9 on: September 13, 2012, 09:21:02 am »
@posde: The batch number is -292. I updated the Trac ticket (http://svn.linuxmce.org/trac.cgi/ticket/1547)

@iberium: It looks like you are missing the device data for username (114) and password (115). Since those were not in the template they did not get added to your device. There is probably some trick to add it manually, but I don't know it by heart.

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
Re: proliphix nt150
« Reply #10 on: September 14, 2012, 01:28:48 am »
I got it working and it is reporting.  My problem is that in my scenarios, it doesn't detect the devices as a climate device.  If I try to use the advanced wizard, it says there are no commands available for this device.  Also, it is reporting in Celsius, i saw functions in there to convert to Fahrenheit.  Is there a parameter I need to use to enable this?  Thanks for all the help!

iberium

  • Veteran
  • ***
  • Posts: 84
    • View Profile
    • Innovative Sight & Sound
Re: proliphix nt150
« Reply #11 on: September 14, 2012, 01:35:15 am »
Actually I just got it,  I had to re-add the temperature and color command groups.  Now it is showing up.  The way I got the un and pw working was just to edit the template.  I had added username and password when it was actually authusername and authpassword.  I then just reset the device and all seems to be working.  Still looking for the C to F conversion.

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: proliphix nt150
« Reply #12 on: September 15, 2012, 02:49:46 pm »
The documentation for command #278 (Set Temperature) has the following description for its parameter:
"Can be absolute, like 20, 18, etc., or relative, like +2, -2, etc.  The temperature is always in degrees celsius, and the application is expected to convert to Fahrenheit if necesssary."
Based on that description I made the driver such that it always uses Celcius as input and output.

I assume there is some option to make LinuxMCE convert all the things that are in Celcius back into Farenheit, but since I use Celcius where I live, I have not needed it so far.

The conversion functions you saw are because the Proliphix thermostat uses Farenheit in its interface.
You could replace the functions decifarhenheit_to_celcius, decifarhenheit_to_decicelcius and celcius_to_decifarhenheit in the Private Methods to not convert anymore (except to do the multiplication/division by 10). In that  case the interface should provide values in Farenheit.
But that might lead to strange results with other parts of LinuxMCE that expect the interface to behave according to its specification (and use Celcius instead).