mongoose.Types.ObjectId è l'ObjectId funzione di costruzione, quello che vuoi usare nelle definizioni dello schema è mongoose.Schema.Types.ObjectId (o mongoose.Schema.ObjectId ).
Quindi deviceSchema dovrebbe invece assomigliare a questo:
var deviceSchema = schema({
name : String,
type : String,
room: {type: mongoose.Schema.Types.ObjectId, ref: 'Room'},
users: [{type:mongoose.Schema.Types.ObjectId, ref: 'User'}]
});