mongoose.Types.ObjectId jest ObjectId funkcja konstruktora, której chcesz użyć w definicjach schematów to mongoose.Schema.Types.ObjectId (lub mongoose.Schema.ObjectId ).
Więc deviceSchema powinien wyglądać tak:
var deviceSchema = schema({
name : String,
type : String,
room: {type: mongoose.Schema.Types.ObjectId, ref: 'Room'},
users: [{type:mongoose.Schema.Types.ObjectId, ref: 'User'}]
});