         if mongoQuery.test(device, p.precondition)
           devicePresets.push(p)
 
-      configurations = accumulateConfigurations(devicePresets)
+      configurations = accumulateConfigurations(devicePresets, objects)
       now = Date.now()
       taskList = []
       expiry = config.PRESETS_CACHE_DURATION



matchObject = (object, param) ->
  return false if not object._keys?
  for k in object._keys
    v = common.matchType(param[k]._value, object[k])
    if param[k]._value != v

  )


getObjectHash = (object) ->
  return object._id if not object._keys? or object._keys.length == 0
  hash = ''
  for k in object._keys
    hash += "#{k}=#{object[k]}"
  return hash

accumulateConfigurations = (presets, objects) ->
  maxWeights = {}
  configurations = {}
  for p in presets
